why do the posts seem to change when i look at the recent tagged instagram API - instagram

when i'm accessing the instagram API via the https://api.instagram.com/v1/tags/nofilter/media/recent and i click refresh on the browser, it seems to get more posts, but the count doesn't change on the app in iOS or on the API. Is there actually more posts being posted or is it just cycling through old ones?

There is a maximal limit of returned media per request: 33 (by now). By default the API should return 20 items. Regardless of refreshing the browser, the number of posts per request does not change.
I assume that you were getting the same number of media after refreshing the browser, but they were new, just being posted on the Instagram. However, they could have more data (longer descriptions etc.), which could give you an illusive impression of more fetched items.

Related

Instagram Graph API - media_product_type not showing STORY

I currently have the below API response for one of our instagram pages using the Graph API that includes media_product_type, even though our Page has a STORY we are not seeing it come through, but we do see FEED and IGTV, see here for the documentation on this field. Has this happened to anyone else?
/12334555/media?limit=100&period=lifetime&fields=name%2Ccaption%2Clink%2Cshortcode%2Ccomments_count%2Cmedia_type%2Cpermalink%2Clike_count%2Ctimestamp%2media_product_type&access_token='blah'
You will need to use the stories endpoint (not media)
eg:
{baseUrl}/{version}/{instagramUserId}/stories?fields=caption,media_url,timestamp,permalink,username,media_type,like_count,comments_count,shortcode,thumbnail_url,video_title,media_product_type&limit=10&access_token={accessToken}
Note: story info is only around for 24 hours, so ideally you polls for infor and then setup the webhook to receive the final counts before the story dissapears.

Did Instagram change API rate limits on Mar 30, 2018?

I use some self developed script to get info about my posts and followers. Recently I discovered that Instagram changed rate limits for my app. I see following info in headers:
x-ratelimit-limit: 200
I learned Instagram blog and page with changes but found no mentions about any changes since Oct 1, 2017.
Is this new limit related only to my token or to entire platform? Could you check your token?
Yes It is, Although no official communication.
I also experienced that.
I found this in their documentation.
The Instagram API uses the same rate limiting as the Graph API (200 calls per user per hour) with one exception: the /media/comments edge limits writes to 60 writes per user per hour. Please refer to the Graph API's rate limiting documentation for more information.
https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting
https://techcrunch.com/2018/04/02/instagram-api-limit/
Hope this will be helpful.
Update:-
Further on 4th April few more APIs deprecated by Instagram.
https://www.instagram.com/developer/changelog/
Some perspective:
This 200 per hour call has been in the Graph API documentation for at least a month (according to wayback machine).
Facebook must have panicked over the weekend and pressed the "require Graph API permissions" button, thus our current situation. :\
Yes,
The limit has been reduced.
Here are some reference links for detailed documentation:
Instagram API limit reduced to 200 from 5000
https://techcrunch.com/2018/04/02/instagram-api-limit/
https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting
Hope it helps
Thanks
Here's our answer: https://www.instagram.com/developer/changelog/
The API deprecated immediately. So really the limits probably don't matter that much anymore. I really don't see myself building another app based on their API...
Here is The New Instagram's Public Api Update , unfortunately Limit rates are worthless for some Features in Instagram .
April 4, 2018
The following endpoints are deprecated immediately:
Follows and Relationships
GET /users/self/follows
GET /users/self/followed-by
GET /users/self/requested-by
GET /users/{user-id}/relationship
POST /users/{user-id}/relationship
Commenting on Public Content
GET /media/{media-id}/comments (Deprecation not relevant when fetching comments for self media)
POST /media/{media-id}/comments
DEL /media/{media-id}/comments/comment-id
Media
GET /media/{media-id}
GET /media/shortcode/{shortcode}
Likes
GET /media/{media-id}/likes
POST /media/{media-id}/likes
DEL /media/{media-id}/likes
User Search
GET /users/{user-id}
GET /users/{user-id}/media/recent
GET /users/self/media/liked
GET /users/search
Subscriptions - to receive notifications when media is posted
Some information on Public Content returned through hashtag and location search will be removed - Name, Bio, Comments, Commenters, Follower Count, Following Count, Post Count, and Profile Picture

WordPress posts keep changing order Android app

I am working on an Android application for my Wordpress site, I've added the Rest API plugins in order to be able to get the data in JSON form.
I am using the following URL to get posts
http://mywordpress.com/wp-json/wp/v2/posts/?categories=1&per_page=100
I am using &per_page=100 because it seems that by default it loads only 10 posts.
My problem is that every time I load posts in my Android app, the posts are displayed in a random order, I am using SwipeRefreshLayout so that I can refresh the posts, but each time I do the refresh the posts are displayed in random ordered, is there a way I can order my posts by date desc?
JSON data can never be relied upon to be in a certain order. Refer to JSON order mixed up
Sort the data to get a certain order.

Instagram API: Any way to increase result returned from hash tag based query?

I recenty saw change imposed by instagram on sandbox account that limits returned result to last 20 recent images https://www.instagram.com/developer/sandbox/#api-behavior.
I need to fetch last six tag based images but in last 20 image there are 3 images with that hash tag.
Is there any way to overcome this?
Its not just last 20 posts in Sandboc Mode, its also last 20 posts from your app's sandbox users. This is a limitation of Sandbox mode.
The behavior of the API when you are in sandbox mode is the same as
when your app is live, but comes with the following restrictions:
Data is restricted to sandbox users and the 20 most recent media from each sandbox user
Reduced API rate limits
Only way to get all is to go live.

Instagram API request more

https://api.instagram.com/v1/users/self/media/recent/?access_token=my_token&count=30
request only 20 data.
I want 30 data.
{
pagination: { },
meta: {
code: 200
},
data: [
{
attribution: null,
tags: [...
can't find pagination in next_max_id.
but https://api.instagram.com/v1/users/self/media/recent/?access_token=my_token&count=1
This code = next_max_id ok.
Do u know what i meen?
sorry, not wall English wirte..
Help Me~
In general, the endpoints are limited to a certain amount of items per request. In order to get around this, endpoints support pagination. Pagination is indicated by the pagination key in the response. It may look like this:
"pagination": {
"next_url": "https://api.instagram.com/v1/tags/puppy/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&max_id=13872296",
"next_max_id": "13872296"
}
In that case, you could pass next_max_id to the previously made request to get the next page which starts from the last id that wasn’t included in the current response. You can also simply request the URL at next_url which is automatically constructed for your by the Instagram API.
You can increase the page size for endpoints by supplying the count parameter. Note that each endpoint has a maximum page size which you cannot go above. So you will have to support paging at some point in order to access more items.
Finally, since you hit the number of 20 items in your response despite specifying a page size of 30, it’s very likely that you are hit by the sandbox mode.
Sandbox mode is a new restriction for Instagram applications created on or after November 17th, 2015. This restriction limits application in various ways, most notably, it limits all endpoints to return a maximum of the 20 most recent media items.
So if you have created your application after that date, this is exactly what you’re running into. Your application is essentially in a test mode. In order to lift these restrictions, you need to get your application reviewed and approved first. As stated in the documentation:
After your app has been reviewed and approved, you are ready to make it available to the general public. To switch your client from sandbox to live mode, you can use the button on the top section of the configuration screen for your app. When you are live, any Instagram user will be able to authorize your app, but you will have access only to the permissions that you were granted during the review.

Resources