Get data from last 3 days from NASA API - api

I am using api.nasa.gov and trying to get data from last three days. But I cannot find what should I add in the url. Cannot find the option to filter out the result.
Can anyone help me out?
This is the url I am using
$url = "https://api.nasa.gov/neo/rest/v1/neo/browse?page=0&size=50&api_key=api_key";

docs on the website state
documentation
prop start_date
prop end_date
https://api.nasa.gov/neo/rest/v1/feed?start_date=2015-09-07&end_date=2015-09-08&api_key=DEMO_KEY
GL :)!

Related

How can I display time like 30 seconds ago or 2 hour ago and update up to days in react native

Hi there I am developing a social application I want to display passed time i.e when the post was created like Facebook for examples created 30 seconds ago or created 2 hour ago and up to days in react-native
You can use momentjs for the same
Example can be :
moment([2022, 05, 22]).fromNow(); // 2 days ago
Or you can pass any date object and use fromNow()
You can get following output based on criteria
In my opinion better library for updating date is dayjs or date-fns. Both libraries are light weight. Specially if you are creating social app where I assume you would like to render a lot of dates.
https://date-fns.org/
https://day.js.org/
In dayjs what are you looking for is: dayjs(someDate).fromNow() from is output like this: 3 minutes ago
Thanks for your help friends I have found my answer. It was a single line and easy using 'moment' library here is how I got it:
let createdAt = moment(moment.now()).fromNow();
for display
<Text> Createdat: {createdAt} </Text>

how to download data from ECB using pandaSDMX?

I am trying to download the NEER data from this target page.
Here is a good example:Most efficient way of converting RESTful output to dataframe
Here is the code to get the OECD data.
import pandasdmx as sdmx
df = sdmx.Request('OECD').data(
resource_id='MEI_FIN',
key='IR3TIB.GBR+USA.M',
params={'startTime': '2008-06', 'dimensionAtObservation': 'TimeDimension'},
).write()
I just wonder where to find and how to search the 'resource_id', 'params' and 'key' to get the EUR NEER data in my target ECB page.
Thank you.
I solved it.
Find the data in https://sdw.ecb.europa.eu/. If not, search other database.
Select and filter until I get the data series.
click the data series, it will show the data in a window. The url of this window gives me the key. https://sdw.ecb.europa.eu/quickview.do?SERIES_KEY=120.EXR.D.E5.EUR.EN00.A
Then use the key to download the data.
df = sdmx.Request('ECB').data(
resource_id='EXR',
key='D.E5.EUR.EN00.A',
params=dict(startPeriod='2019-01', endPeriod='2019-06'),
).write()
The remaining question is that if I can search directly using the code instead of visiting the website.

YouTube API Search v3 - Start index?

I'm using the YouTube Search API to grab 5 videos per time under a specific keyword. But I've been trying and trying, but couldent find the parameter for the start index. Does anyone know how to add it, so it gets the next 5 videos etc..?
Current URL I have:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=wiz+khalifa&type=video&key=AIzaSyB9UW36sMDA9rja_J0ynSYVcNY4G25
In the results of your first query, you should get back a nextPageToken field.
When you make the request for the next page, you must send this value as the pageToken.
So you need to add pageToken=XXXXX to your query, where XXXXX is the value you received in nextPageToken.
Hope this helps

Is it correct that the Instagram Location/Search endpoint does NOT support pagination?

I have read several postings about the fact that the Instagram API returns only 20 results at a time. In many cases, people have suggested that all you need to do is to use the next URL which is returned in the pagination information. I would be fine with that, but the JSON returned by
https://api.instagram.com/v1/locations/search?
does not appear to have any pagination information. I have seen a posting that says that /media/search does not support pagination. I just wanted to confirm that the same is true for /locations/search. Can anyone confirm?
And if this is correct, does anyone have any thoughts about how you can get a list of all Instagram events in a specific area, rather than just the first 20 or so?
/media/search end point does not have pagination, but you can get next set of 20 pics by using url param max_timestamp, get the created_time of the last photo in api response and apply it as max_timestamp for next url call, it will return the next 20. Thats how I implemented here: http://www.gramfeed.com/instagram/map
for locations/search end point, timestamp does not apply, you can change distance url param and get more results: http://www.gramfeed.com/instagram/places

Google Custom Search API, Howto return country specific results only

I am making some PHP code which takes a given search phrase and url and searches through the google search results until it finds the url (only first 100 results). My problem is, this is only working for the US. I have tried adding the "&cr=" option, but it still on returns US results.
The full URL I am using for the request is:
https://www.googleapis.com/customsearch/v1?key=API_KEY&cx=CX_VALUE&q=KEYWORD&cr=COUNTRY&alt=JSON
Does anyone have any experience with this? I want to be able to see UK results. Tried inserting &cr=countryUK , but still only does US results.
Thanks :)
Regards,
Stian
Use the gl=<country code> param to limit it to your country of choice (so gl=gb for the uk).
More info here:
http://googleajaxsearchapi.blogspot.com/2009/10/web-search-in-your-country.html