nasa / apod-api

Astronomy Picture of the Day API service
Apache License 2.0
808 stars 155 forks source link

Production Use #50

Open nicholasviscomi opened 3 years ago

nicholasviscomi commented 3 years ago

Is there any way I can pay for unlimited/really high usage rates? I have a cool iOS app and want it to be fully funcitonal

akionsight commented 3 years ago

You can generate multiple API keys, one for each user. This will reduce the server load too.

WARNING: I am not the staff here, refer to the staff's guidelines before making any decisions

nicholasviscomi commented 3 years ago

@akionsight Would you be able to tell me how I can generate a key for each user?

akionsight commented 3 years ago

I wouldn't do this without permission from the staff but you can do that with something like a puppeteer or selenium script running on the server-side that generates API keys by accessing the nasa open API's website. the generated API key can be sent to the app for use.

Warning: Do not do this without permission from the staff.

akionsight commented 3 years ago

or generate one key, and use that key once a day to refresh the content on your server and send back data from your server instead of each user accessing it from the apod-api server

nwunderly commented 3 years ago

You can also host the API backend yourself. All it does is scrape apod.nasa.gov anyway. In fact, the README seems to recommend doing this when you need reliable access to APOD data.

akionsight commented 3 years ago

I won't recommend scraping because the scrapers might get blocked, hence generating a fairly large failure for the app

nwunderly commented 3 years ago

It's possible, but considering both the fact that the official APOD API is in fact scraping the APOD site, and that the readme recommends hosting your own if you need "an extremely reliable version of this API", I suspect the site isn't too harsh against scrapers.

hemangshah commented 3 years ago

Hi @nicholasviscomi , you can follow steps provided by Pawel and use deploy the modified API work to your server/heroku and use it. https://github.com/PawelPleskaczynski/apod_api