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

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.

Related

Using web scraping to recive all Twitter followers

I want to create giveaways which require the participants to follow the twitter account of the giveaway creator.
My first idea was to use the Twitter API (endpoint: "/2/users/:id/followers"). This works fine for me however I always run into rating limits. The API allows me to send 15 requests every 15 minutes and returns a maximum of 1000 users per request. Since many accounts have more then 15000 followers and since many request happen at the same time (many users want to participate in a giveaway) this solution is not suitable for me.
My secound idea was to use web scraping instead (e.g Node Fetch). I was following along this tutoria: However doing so I always run into the issue that Twitter uses random strings to name their html elements. You can see in the picture there is no defined class to grap the elements.
So my main question is how can I access these element ?
Random Follower of my Twitter Account
I also have a follow up question regarding the effictivness of this method. Assuming I have multiple people who want to particpate in a short amount of time (e.g 10 people in 5 minutes) and they all need to follow a big twitter account (e.g 100k followers).
Is it efficent to scrape all 100k followers each time or should I instead try to fetch the 100k followers once, safe them to my database and use my database to check for each user later ?
As a side note, I am using node.js and node-fetch, however I have no problems to switch the framework. In addition I think the grabbing of the element as well as the performance should be universal.
Thanks for your help :)
They're going to detect your servers excessive calls. There is a Twitter Developer Portal where you can request elevated access which may raise the limits for you.
https://developer.twitter.com

How to get daily usage of Youtube API qouta?

I am using youtube data API and I didn't find anything related to the overall daily usage of API limit.
I can check the same on the console and I visited the below link but here I can only calculate the stats from the youtube web portal.
https://developers.google.com/youtube/v3/determine_quota_cost
Is there any means that I can get the overall daily usage of from any API provided by youtube.
Yes. Go to here, click on the menu in the top left corner, IAM & Admin and then Quotas.
Recently I had this requirement too. But then I moved on as it was not a blocker for me.
Alternatively I would suggest keeping track of quota units consumed. You can easily calculate how many quota units are consumed from the chart in the link you provided. You can get the number of quota units left by subtracting the sum of units consumed from 10000 (Current default limit, or any number assigned to your account if you requested for more).
The quota gets reset every midnight PST.
FYI, the api does respond with an HTTP 403 and error code 403 with reason = dailyLimitExceeded. Once you encounter this then you can stop sending out more api calls till midnight.
If you ever get to know of an API endpoint please update this question so that it helps people like us.

Instagram posting comment exceed rates

I'm posting a comment to a content on Instagram using Instagram API.
My app is registered and approved, so I was supposed to have 60 comments per hour (or at least 30, in case it is still in Sandbox mode).
I keep getting this message:
The maximum number of requests per hour has been exceeded. You
have made 23 requests of the 15 allowed in the last hour
I can't understand where does the 15 request allowed per hour came from.
Couldn't find it anywhere in the documentation as well.
Well, I would suggest you to go to the developer dashboard(MANAGE CLIENTS) page and report this issue. Its an option there. After that wait for a day and then check your mail. You might find a reply from them. As you have transitioned from the sandbox mode to active, the limit should increase and I hope they fix it for you
Just some ToC I found.
Instagram may rate limit or block apps that make a large number of
calls to the API that are not primarily in response to direct user
actions. Details Here
And also here
Display more than 30 Instagram photos or videos per page in your
application or use an unreasonable amount of bandwidth.Found Here
It sounds like they could acutely intent to limit your requests to preserve their bandwidth. 15 requests seems like a reasonable amount, if you contact them with a reason why you'd necessarily require more they might up this limit.
Also interestingly, they can change this if they see fit
Instagram may elect to provide you with support or modifications for
the Instagram APIs (collectively, "Support"), in its sole discretion,
and may terminate such Support at any time without notice to you.
Instagram may change, suspend, or discontinue any aspect of the
Instagram APIs at any time, including the availability of any
Instagram APIs. Instagram may also impose limits on certain features
and services or restrict your access to parts or all of the Instagram
APIs or the Instagram Web site without notice or liability.Details Here
Hope this helps

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.

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

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.

Resources