The Social Media Scraping API allows you to scrape information from Instagram.
The API uses GraphQL targets which return data in JSON.
While the targets in this page use GraphQL under the hood, they are interfaced with via REST.
The following Instagram targets are available:
Target | Sync | Async | Batch | Pagination |
---|---|---|---|---|
instagram_graphql_user_posts | ✅ | ✅ | ✅ | |
instagram_graphql_profile | ✅ | ✅ | ✅ | |
instagram_graphql_post | ✅ | ✅ |
Instagram GraphQL User Posts
Returns information about a specific Instagram user.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
target | string | ✅ | target | instagram_graphql_user_posts |
query | string | query | Instagram user profile name | nba |
cursor | string | next 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.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
target | string | ✅ | target | instagram_graphql_profile |
query | string | ✅ | Instagram profile name | nba |
Return value JSON:
- Basic information (name, description, follower count).
- 12 most recent posts.
Instagram GraphQL post
Returns information from a specific Instagram post.
This target does not support batch integration.
Parameter | Type | Required | Description | Example | |
---|---|---|---|---|---|
target | string | ✅ | target | instagram_graphql_post | |
url | string | ✅ | Instagram post URL | <https://www.instagram.com/p/ChYHpdAvnob> |
Create callback for Instagram post
POST https://scraper-api.smartproxy.com/v2/task
Payload type: JSON
Parameter | Type | Required | Description | Examples |
---|---|---|---|---|
target | string | ✅ | target | instagram_graphql_post |
url | url | ✅ | Instagram post URL | https://www.instagram.com/p/ChYHpdAvnob |
curl -u username:password -X POST --url https://scraper-api.smartproxy.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.smartproxy.com/v2/task/{Task_ID}/results?type=parsed
Retrieve raw HTML results via callback
GET https://scraper-api.smartproxy.com/v2/task/{Task_ID}/results?type=raw
Updated 26 days ago