Instagram Rate limiting

Rate limiting

The Instagram API enforces rate limiting - meaning that you can only make a certain amount of request over a given time. Most methods have rather high limit, while a few methods has a very low limit. Instagram.com has a good description of limits.

If the API responds with a rate limiting error, Skybrud.Social will throw an exception of the type InstagramOAuthRateLimitException. It is highly recommended to read about error handling to properly catch this exception.

Rate limiting information

All responses from the Instagram API will contain rate limiting information - eg. as illustrated by the example below:

@using Skybrud.Social.Instagram.Responses.Locations
@inherits WebViewPage<Skybrud.Social.Instagram.InstagramService>

@{

    // Request information about a specific location (in this case our offices at Skybrud.dk)
    InstagramGetLocationResponse response = Model.Locations.GetLocation(241201111);

    // Print the rate limiting information
    <p>Rate limit: @response.RateLimiting.Limit</p>
    <p>Rate remaining: @response.RateLimiting.Remaining</p>

}