Exceeding Instagram API request limit - instagram

How can I possibly exceed the Instagram API limit of 500 requests per hour if I have code in place that caches every 15 seconds (240 requests per hour)?
UPDATE: We ended up creating a new client, generating a new access token and using that in in our app. So far so good. Our code is making 1 call per minute, caching it and displaying the cached data for most visitors. The only thing I can think of is maybe something else was using our access token - leaking our bank of requests. I wish Instagram kept a log or something so we could see if requests were coming from an unauthorized source.

which API is it?
Instagram POST APIs have different limits (30/hr in sandbox and 60/hr in live mode):
/media/media-id/likes
/media/media-id/comments
/users/user-id/relationships
combined all API calls have 5000/hour.
https://www.instagram.com/developer/limits/

Related

Best way to request API and store every minute

I have an app that is hitting the rate limit for an API which is hurting the user experience. I have an idea to solve this but have no idea if this is what should be done ideally to solve this issue. Does this idea makes sense and is it a good way to solve this issue? And how should I go about implementing it? I'm using react-native and nodejs.
Here is the idea:
My app will request the data from a "middleman" API that I make. The middle man API will request data once per minute from the main API that I am having the rate limit problem with (this should solve the rate limit issue then) then store it for the one minute until it updates again. I was thinking the best way to do this is spin a server on AWS that requests from the other API every minute (Is this the easiest way to get a request every minute?) then store it on either a blank middleman webpage (or do I need to store it in a database like MongoDB?). Then my app will call from that middleman webpage/API.
Your idea is good.
Your middleman would be a caching proxy. It would act just as you stated. Hava a look at https://github.com/active-video/caching-proxy it does almost what you want. It creates a server that will receive requests of URLs, fetch and cache those, and serve the cached version from now on.
The only downside is that it does not have a lifetime option for the cache. You could either fork to add the option, or run a daemon that would delete the files that are too old to force a re-fetch.
EDIT:
A very interesting addition to the caching-proxy would be to have a head request to know if the result changed. While this is not provided by all API, this could become useful if yours is displaying such info. Only if HEAD requests do not count toward your API limits...

Bulk async calls to FB and G+ count endpoints fail

my app has a controller that outputs the total social count for various pages: http://pastebin.com/MLBTb3mi
..it works fine when i'm making a few calls at a time but say when there is a website of 1000 urls and i want to update the social count for each of the urls, it breaks when its hit with volume calls asynchronously - particularly g+ and fb break. Here's the console error I get as the response to the call made to fb's graph id (this is the 'body' response - please refer to line 74 of the controller: http://pastebin.com/MLBTb3mi
facebook body is {"id":"970371719648388","created_time":"2015-04-02T07:43:09+0000","is_scrap
ed":false,"type":"website","updated_time":"2015-04-02T07:43:09+0000","url":"http:\/\/www.zappos.com\/womens-clothing\/"}
facebook result is undefined
Does anyone know how to solve this issue and to make the controller work smoothly?
I tried making bulk calls using sharedcount.com and i'm able to do 10s of thousand of simultaneous calls without any problem. How can I write my controller to handle such bulk operations without using external services like sharedcount?
You should examine the status code of the response. My guess is that you're getting rate-limited. See the Facebook page on rate-limiting for details; it doesn't discuss specific numbers on what will get you blocked, but it provides details on what to look for to indicate that you're being throttled. The solution is to throttle requests on your end so that they don't go out too fast; you can use something as simple as Lodash's _.throttle for this.

API rate limiting issue

I am always and constantly getting the following error when trying to follow a user via instagram although the 5000 request limit hasn't been exceeded. Why is this?
{"meta":{"error_type":"APIError","code":400,"error_message":"Client request limit reached"}}
While API request with access token is 5000 (any API call), certain API like follow, unfollow, like, comment are limited to 350 an hour.
I had the same problem. In my case I sent post requets from server side (google app engine) and now I am sending post requests from client (with js) and it works well.
It depends on your request. Instagram has a new API limit, 100 likes/hr, 60 follow/unfollow/hr IF you authenticate server side and sign your headers, check out the Instragram authentication for developers.
I'm currently running a website: http://instapromobiz.com that automates likes/follows/unfollows using these restrictions. It works great, check it out.

Get Photos and Detailed Info for Many Foursquare Venues in one call

I am working on an iPhone app which allows users to search Foursquare. I am using the venues/explore endpoint for the search which works great, but the results don't include the images for a place or the priceTier.
Right now I am calling /venues/VENUE_ID for each of the returned results, which is generating a lot of API calls. Is there a better way to get this info in a single call?
Related question: If I use the multi endpoint to batch these requests, does that count as a single request towards the limit or as multiple requests?
Sounds like you're worried about limits more than network latency? If you're worried that making the extra call to details will make you hit rate limits faster, this is actually why we generally ask developers to cache details such as prices or photos :) A single multi request is not a single API call; it counts as how many requests are bundled into one.
There is a little help with photos though—if you pass in the venuePhotos=1 param as part of an explore request, you ought to get back photos in the response.

Google Weather API returns HTTP 403 Error

I use the Google weather API in my web site, and today I get an error that the API link doesn't return any data.
When I check the link directly I get an (Error 403).
Here is the link.
Can anyone please tell me a solution for this and provide me another link for the API?
Every now and then the API stops working for short periods of time, the last days more often a 403 is trown. For my site, last night it happened 13 times. But the site tries immediately again and the second or third time, the data loads without problems. As the API is unofficial, not sure what’s causing the 403.
Make sure you cache the data as the API will block your IP temporary when you make too much requests. In my case, I cache for 20 minutes and if no data can retrieved, the site will not try more than 10 times to reload the API. Once I forgot to turn caching on after debugging and as my site did many hundred requests (with every visitor), the IP was blocked within an hour. If a remember correct, the error was not a 403. Fortunately, the block lasts for less than a half day.
There is currently an intermittent 403 Forbidden response to the Google Weather API that you are using. See Google Weather API 403 Error
The reason for the intermittent 403 response is not known but has been a problem since the 7th of August 2012.

Resources