Comments (18)
https://api.nasa.gov/planetary/apod/direct?[insert API key here]
Returns Error 500
from api-docs.
Yup same error here. I thought this problem was solved years ago?
https://api.nasa.gov/planetary/apod/direct?date=2015-06-03&api_key=DEMO_KEY
returns
{ "code": 500, "msg": "Sorry, unexpected error: must be str, not NotFound", "service_version": "v1" }
from api-docs.
Yep, I don't know if it's a temporary problem because I stared using the API just a few days ago but it always returns:
{ "code": 500, "msg": "Sorry, unexpected error: must be str, not NotFound", "service_version": "v1" }
It would be very nice to have (again) CORS enabled images :-)
from api-docs.
+1
from api-docs.
thanks. I will work on this really soon -- this week?! thanks for the note.
from api-docs.
+1
I would also really love to avoid jsonp
from api-docs.
+1
CORS support would definitely be appreciated.
from api-docs.
+1
from api-docs.
Thanks so much for the issues. I am slowly working my way through them. CORS support is now supported for the APOD API. (I will now move on to the Landsat API to address #39.) And I'll close this issue, once I update the documentation.
There is also a new endpoint to allow CORS support for the image itself, rather than just the JSON response. So, check it out:
QUERY:
https://api.nasa.gov/planetary/apod?date=2015-06-03&api_key=DEMO_KEY
RESONSE:
{
"url": "http://apod.nasa.gov/apod/image/1506/hyperion02_cassini_960.jpg",
"media_type": "image",
"explanation": "Why does this moon look like a sponge? To better investigate, NASA and ESA sent the Saturn-orbiting robotic spacecraft Cassini zooming past Saturn's moon Hyperion, once again, earlier this week. One of the images beamed back to Earth is featured above, raw and unprocessed. Visible, as expected, are many unusually shaped craters with an unusual dark material at the bottom. Although Hyperion spans about 250 kilometers, its small gravitational tug on Cassini indicates that it is mostly empty space and so has very low surface gravity. Therefore, the odd shapes of many of Hyperion's craters are thought to result from impacts that primarily compress and eject surface material -- instead of the more typical round craters that appear after a circular shock wave that explosively redistributes surface material. Cassini is on track for another flyby of Saturn's Dione in about two weeks. Retrospective: All Previous June 3 APODs",
"concepts": null,
"title": "Flyby Image of Saturns Sponge Moon Hyperion"
}
HEADERS:
accept-ranges:bytes
access-control-allow-origin:*
age:0
alternate-protocol:80:quic,p=0
cache-control:no-cache
Connection:keep-alive
content-encoding:gzip
Content-Length:662
Content-Type:application/json
Date:Wed, 03 Jun 2015 16:24:45 GMT
Server:nginx
vary:Accept-Encoding, Accept-Encoding
via:1.1 varnish-v4
x-cache:MISS
X-RateLimit-Limit:30
X-RateLimit-Remaining:24
x-varnish:15443927
If you want the image directly with CORS support, hit this new endpoint:
QUERY:
https://api.nasa.gov/planetary/apod/direct?date=2015-06-03&api_key=DEMO_KEY
RESPONSE:
HEADERS:
accept-ranges:bytes
access-control-allow-origin:*
age:0
alternate-protocol:80:quic,p=0
cache-control:no-cache
Connection:keep-alive
Content-Length:538966
Content-Type:image/png
Date:Wed, 03 Jun 2015 17:03:18 GMT
Server:nginx
via:1.1 varnish-v4
x-cache:MISS
X-RateLimit-Limit:30
X-RateLimit-Remaining:21
x-varnish:15195289
More generally, there is a lot to do. Caching, CI testing, etc. I will systematically address the issues; and then I am going to solicit help! The only reason why this isn't a totally open project is that there are internal credentials that I need to mask out before public release. After I do that, it would be awesome to have some help or code reviews!
from api-docs.
Thanks so much, Dan! Can't wait to give it a try.
from api-docs.
Great work Dan! Once I stop being an idiot at JS I'll be using this thoroughly
from api-docs.
Excellent! I was able to query/receive the APOD JSON string from my local test webserver that serves up an AngularJS test app. Sweet! I'm sure we will all help out with testing ... just light the beacons!
UPDATE - the direct endpoint also works ...
-Ben
Benjamin H Boruff
[email protected]
benjaminboruff.github.io
from api-docs.
awesome! thanks for the support @wnodom, @AdamMurray, and @benjaminboruff! I am progressively adding features, trying desperately not to change the structure of the response (just adding to it). The new Landsat endpoints are going to be sweet.
from api-docs.
Closing issue as it looks solved (and, I'll note that CORS is enabled in Flask APOD-API)
from api-docs.
@Huc91 i just created a new issue, feel free to report there
from api-docs.
please try again
from api-docs.
@jasonduley as stated in #99 (comment) the "direct" url is broken so i just used the normal URL and it's working. People (like me) might find this thread and waste a lot of time trying to use the 'direct' URL though.
from api-docs.
I'm having the same issue. The direct URL is broken and the other one doesn't allow me to use the image url in my code due to a CORS error. Any chance of getting this looked again? Thanks so much!
from api-docs.
Related Issues (20)
- API Key in the open?
- Broken Link: Satellite Situation Center HOT 3
- APOD API 503 error HOT 6
- APOD 502 Bad Gateway HOT 1
- Making an API call even with the DEMO_KEY is returing 502 Bad Gateway HOT 1
- APOD endpoint returning 502 HOT 3
- APOD endpoint returns 504 HOT 5
- EONET API v3 get response is not valid json HOT 1
- HORIZONS api response in JSON format looks weird HOT 2
- Unable to create an API Key HOT 1
- Satellite Situation Center Links broken?
- Planetary Earth API Not Working HOT 4
- Typographical error on "earth"
- OVER_RATE_LIMIT across APIs and Keys HOT 2
- HTTP FAILED: java.net.UnknownHostException: Unable to resolve host "api.nasa.gov": No address associated with hostname HOT 1
- API for GCN circulars
- Mars Rover Photos: curiosity and spirit off air HOT 1
- APOD-Api, EPICData, Nasa Image and Video Lib (new doc) not working
- Link about EONET API documentation leads to depracated API.
- Internal Server error (500) when using earth api HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-docs.