Instagram

Web Scraping API Instagram Target

The API uses GraphQL targets which return data in JSON.

📘

Specific target templates listed below are available with Advanced plans.
You can scrape Instagram target with Coreplans as well by providing page URL (it does not support parsing or target specific parameters). Both solutions can be tested in the Playground in Dashboard.

Read more about Coresolution here.

📘

While the targets in this page use GraphQL under the hood, they are interfaced with via REST.

The following Instagram targets are available:

TargetSyncAsyncBatchPagination
instagram_graphql_user_posts
instagram_graphql_profile
instagram_graphql_post

Instagram GraphQL User Posts

Returns information about a specific Instagram user.

ParameterTypeRequiredDescriptionExample
targetstringtargetinstagram_graphql_user_posts
querystringqueryInstagram user profile namenba
cursorstringnext page string (look for end_cursor value in response)3547611165414990351\_1067259270

Pagination

When making an initial request:

{
    "target": "instagram_graphql_user_posts",
    "query": "nba"
}

The response will contain an end_cursor:

{
    ...
    "page_info": {
        "end_cursor": "3547611165414990351_1067259270",
        "has_next_page": true,
        "has_previous_page": false,
        "start_cursor": null
    },
    ...
}

This cursor can be user to fetch the next page of results:

{
    "target": "instagram_graphql_user_posts",
    "query": "nba",
    "cursor": "3547611165414990351_1067259270"
}

Instagram GraphQL profile

Returns information about a specific Instagram user.

ParameterTypeRequiredDescriptionExample
targetstringtargetinstagram_graphql_profile
querystringInstagram profile namenba

Return value JSON:

  • Basic information (name, description, follower count).
  • 12 most recent posts.

Instagram GraphQL post

Returns information from a specific Instagram post.

ParameterTypeRequiredDescriptionExample
targetstringtargetinstagram_graphql_post
urlstringInstagram post URLhttps://www.instagram.com/p/ChYHpdAvnob

Create callback for Instagram post

  POST https://scraper-api.smartproxy.com/v2/task

Payload type: JSON

ParameterTypeRequiredDescriptionExamples
targetstringtargetinstagram_graphql_post
urlurlInstagram post URLhttps://www.instagram.com/p/ChYHpdAvnob
curl -u username:password -X POST --url https://scraper-api.decodo.com/v2/task -H "Content-Type: application/json" -d "{\"url\": \"https://www.instagram.com/p/ChYHpdAvnob/\", \"target\": \"instagram_graphql_post\",\"locale\": \"en-us\",\"geo\": \"United States\" }"

Retrieve parsed results via callback

GET https://scraper-api.decodo.com/v2/task/{Task_ID}/results?type=parsed

Retrieve raw HTML results via callback

GET https://scraper-api.decodo.com/v2/task/{Task_ID}/results?type=raw

Support

Still can't find an answer? Want to say hi? We take pride in our 24/7 customer support. Alternatively, you can reach us via our support email at [email protected].

Feedback

Something's missing? Request an article!
Got feedback? Let us know how we're doing and what can be improved.


```