Media Instagram Last month - api

I'm creating this Instagram Integration and I'm using https://api.instagram.com/v1/media/search endpoint.
I want to know if is possible to get all the medias for an specific month, with the min and max timestamp.
I'm seeing on the documentation that The time span must not exceed 7 days.
Is there a way to do it?
Thanks!

Depends if you're willing to make multiple requests. They only give you a handful of media on each query so to get all the media from the last month you'll have to paginate your request, changing the "max_timestamp" to be the created_time from the oldest media you got on the previous request. You can keep going back in time until you've pulled everything from the last month.

you can set the min_timestamp and max_timestamp to a month and make a request, you still have to make pagination calls to get all media.
Here is an implementation: http://www.gramfeed.com/instagram/map
Set the time range and map location and search, scroll to load all media.

Related

"Whats new" date restriction on API

I am developing an app with the Active Collab API using the What's New endpoint.
I am retrieving this regularly, so I have the latest information. I was wondering if there was a way to specify the activity by date to get the items since then?
For example, instead of getting 50 records and processing the 50 every time, if I could pass a from parameter (with a timestamp) to only collate activity since that time then that would help with both my processing and the size of the request (and knowing how many things have happened since)
Is this possible?
What's New API end point only has a daily filter:
/whats-new/daily/YYYY-MM-DD
Both global and daily What's new API end-points are paginated, so you can loop through responses by providing (and incrementing) page GET argument:
/whats-new?page=2
until you reach records that are older than the timestamp that you are looking for (or get an empty result). At that point, you just break and you have all the updates that were looking for.

Google Fit API - Real Time Data

I am trying to show in my application the steps that the user walked per day in real time but I am not able to. I tried to get the steps using TYPE_STEP_COUNT_CUMULATIVE but I am able to get all the steps from the day that user started using the application.
When I tried to use other type, for example DELTA, it's not working. Not sure if I am missing something. I am able to get the daily steps from HISTORY API but I cannot use them for real time because UI does not allow to use await().
Any suggestions?
The com.google.step_count.cumulative data type represents step count data as a sum since the start of the count. So this is not the one that you need.
From this documentation, it is stated here that Google Fit also provides simple access to the daily total of a specified data type. Use the [HistoryApi.readDailyTotal()](https://developers.google.com/android/reference/com/google/android/gms/fitness/HistoryApi#readDailyTotal(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.fitness.data.DataType)) method to retrieve the data type that you specify as of midnight of the current day in the device's current timezone. For example, pass in the TYPE_STEP_COUNT_DELTA data type to this method to retrieve the daily total steps. You may pass in an instantaneous data type that has an aggregate daily total.
But, if you want a real time data, you need to use the Sensors API together with the Recording API. Source: Record Fitness Data
For more information, check this related SO question:
Get current day's steps during datapointListener google Fit

Obtaining System Log using Okta API

I would like to do the following using OKTA api:
One time, I would like to pull the entire system log.
Going forward I would like to pull only the days log information.
The challenge that I am facing is whenever I get the logs, I only get 1000 records. How do I get the whole days log, it maybe more that 1000 records. Is there some body who can help me with a piece of code which shows how to do this.
Thanks
You can use the Events API to retrieve this information. This API supports Pagination so you can retrieve all the events for a particular filter (like all events after a certain point in time).
1000 is the default limit for the Events API because this object can potentially contain a lot of data.
However, you can specify how many records for a specific time range are returned via the Events API using filters. For example, the following GET statement would retrieve the first 100 successful login requests since 1-Mar.
https://{{YOUR_COMPANY}}.okta.com/api/v1/events?limit=100&filter=published gt "2015-01-01T00:00:00.000Z" and action.objectType eq “core.user_auth.login_success"
If there are more than 100 records, you can get the next set by passing rel=“next” in the next request header. If you wanted to get only messages for today, you could change the date.

Venue History Pagination

How are we supposed to paginate through the venuehistory (https://developer.foursquare.com/docs/users/venuehistory) endpoint? In the docs, it mentions two parameters, beforeTimestamp and afterTimestamp, but the result set contains no reference timestamp points to paginate from. Am I missing something?
Background
I'm testing currently testing on an account with 22 items, so perhaps the pagination hasn't kicked in yet, but it would still be nice to cover this scenario. Thanks!
/users/venuehistory returns the user's whole venuehistory, so typically you do not need to paginate it. The beforeTimestamp and afterTimestamp are used if you want to only show history from a certain time period (such as only showing check-ins in January, for a calendar view of check-ins).

Can you get the exact date a user started following another using the twitter API?

Let's say user A follows user B, and B follows A. I want to know the exact date A started following B and viceversa.
Is this information stored on twitter? Can I retrieve it using the API?
To clear out: The point of this question is finding a way to know who followed who first.
(I'm assuming both A and B deleted the notification e-mails)
No Ignacio, you can't. You just can know who follows who but not the date the follow started.
Looking at the API, there's is no way, there are two calls to get the followers:
User Methods/statuses/followers
and
Social Graph Methods/followers/ids
Neither of them returns dates or even a serial that would let you see who started following first. Really, there's no indication that twitter is internally storing this information, neither in the API nor Twitter's web interface.
This is a very old question, but perhaps some might be interested to know that while you cannot get the date at which someone started following, you can at least infer an "earliest possible following date" from the fact that the list of followers is ordered according to date, and the fact that follower objects come with a created_at timestamp.
Here's a Python function for calculating an "earliest possible following date": https://github.com/BernhardClemm/twitter-follow-dates
Of course Twitter stores it, because Twitter sorts followers and following lists by the date ;)
It is possible to do this, but impractical. When you call the followers API you can page the results. Each returned object contains next_cursor and prev_cursor items. These refer to the first and last records in the next and previous pages. These values are time based and can be used to calculate the time that the respective users followed you.
It follows that, if you set the page size to 1, you can walk through the list of follower IDs one at a time and the next_cursor value will allow you to derive the follow time for the next record.
This is reasonably simple to implement, however, in practice, you'll very quickly hit Twitter's API rate limit.