Extract post metadata
Scrape post metadata
Input an Instagram post URL to collect detailed metadata, including engagement metrics, captions, small subset of comments, and media information.
Base URL
POST https://instagram-scraper-api.datashake.com/v1/scrape
Request payload
callback_url
Field type: string
Required: true
Description: A URL to receive API results via a JSON POST request.
url
Field type: string
Required: true
Description: URL of the Instagram post to scrape.
get_comments
Field type: boolean
Required: false
Description: Set this to true
to collect comments. Retrieve them using the comments endpoint after request completion.
external_identifier
Field type: string
Required: false
Description: A custom identifier for tracking your request. This value will be included in the callback payload.
Code example
curl --location 'https://instagram-scraper-api.datashake.com/v1/scrape' --header 'x-api-key: your-api-key' --header 'Content-Type: application/json' --request POST --data '{"url": "https://www.instagram.com/p/DFtCWGsTqIp/", "callback_url": "https://example.com/callback", "external_identifier": "my-custom-id", "get_comments": true}'
import requests
url = "https://instagram-scraper-api.datashake.com/v1/scrape"
payload = {
"url": "https://www.instagram.com/p/DFtCWGsTqIp/",
"callback_url": "https://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true
}
headers = {
"x-api-key": "your-api-key",
}
response = requests.post(url=url, headers=headers, json=payload)
Response and callback payload
API response example
{
"status": "created",
"message": "Your request was successfully submitted.",
"request_id": "1742515679047322765-7538bd54-2bd7-45"
}
Callback payload example
{
"request_id": "1742515679047322765-7538bd54-2bd7-45",
"status": "completed",
"credits_used": 130,
"request_metadata": {
"url": "https://www.instagram.com/p/DFtCWGsTqIp/",
"callback_url": "http://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true
},
"results": [
{
"unique_id": "3571911824431822816",
"post_id": "DGR-uEoRrfg",
"description": "@cecred x @ultabeauty — 4.6.25",
"hashtags": [],
"url": "ttps://www.instagram.com/p/DGR-uEoRrfg/",
"comments_count": 35491,
"likes_count": 1538960,
"view_count": 7959651,
"play_count": 22863362,
"upload_date": "2025-02-20",
"author": {
"username": "beyonce",
"name": "Beyoncé",
"id": "247944034",
"profile_picture_url": null
},
"tagged_users": null,
"media": [
{
"type": "video",
"thumbnail_url": "https://instagram.frmq2-2.fna.fbcdn.net/v/t51.2885-15/480746587_18537356002008035_6860679811123102568_n.jpg?stp=dst-jpg_e35_p1080x1080_sh0.08_tt6&_nc_ht=instagram.frmq2-2.fna.fbcdn.net&_nc_cat=111&_nc_oc=Q6cZ2QGh_YTQRa7YJx7TXNWwGCG_WRCkqBC5rROfnmfbo4lrTB9fjRmeCHcZpmaKPz5bMI8&_nc_ohc=3oaLKauBkcAQ7kNvgE7RqbQ&_nc_gid=1vwAb-gaOPNNKKRihstv-Q&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYHsrTwVUDz7fiIVrVg-YVduKnWKKRmpNYRfuhVtiRs01Q&oe=67F1F725&_nc_sid=10d13b",
"url": "https://scontent.cdninstagram.com/o1/v/t16/f2/m86/AQPPw1RtmAJ_c3YWM5w35QXL8aZPZDxl9cOpOL96mjqdw8B2E7Hry9Q8wTal6-_gilVCr3pisIjjS_fHxSzPyPcqPg0VSMkRa9Itoks.mp4?stp=dst-mp4&efg=eyJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSIsInZlbmNvZGVfdGFnIjoidnRzX3ZvZF91cmxnZW4uY2xpcHMuYzIuNzIwLmJhc2VsaW5lIn0&_nc_cat=103&vs=950010947115910_3300839751&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC9ERjQxMEQwQzMwQTlDRTdFOUFCMjlERUQ5N0VBNUY5N192aWRlb19kYXNoaW5pdC5tcDQVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dIZHZneHhoUmlkU0hDOEVBT2VoOV9MekxuVlNicV9FQUFBRhUCAsgBACgAGAAbABUAACaQz%2BD%2B6Pz7PxUCKAJDMywXQDGiDEm6XjUYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=f7c64edac6&ccb=9-4&oh=00_AYFHgJ7wsx7Op7pGxg7kdlaxsd8lggo7zLsaYUpEbWz8DQ&oe=67EDFCE7&_nc_sid=10d13b",
"id": null,
}
],
"created_at": "2025-03-21T00:08:07.793135Z",
"updated_at": "2025-03-21T00:08:07.793136Z",
},
...
],
"summary": null,
"pagination": null
}
Get scraping results
Use this endpoint to retrieve results in a synchronous manner.
Note that this endpoint is not intended for polling - make sure to check if your request has completed before calling it.
Base URL
GET https://instagram-scraper-api.datashake.com/v1/scrape/:request_id
Path parameters
request_id
Field type: string
Required: true
Description: The unique identifier for the request.
Code example
curl --location 'https://instagram-scraper-api.datashake.com/v1/scrape/1742517759478683074-2b1a61cf-89d0-4d' --header 'x-api-key: your-api-key'
import requests
url = "https://instagram-scraper-api.datashake.com/v1/scrape/1742517759478683074-2b1a61cf-89d0-4d"
headers = {
"x-api-key": "your-api-key",
}
response = requests.get(url=url, headers=headers)
Response
API response example
{
"request_id": "1742515679047322765-7538bd54-2bd7-45",
"status": "completed",
"credits_used": 130,
"request_metadata": {
"url": "https://www.instagram.com/p/DFtCWGsTqIp/",
"callback_url": "http://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true
},
"results": [
{
"unique_id": "3571911824431822816",
"post_id": "DGR-uEoRrfg",
"description": "@cecred x @ultabeauty — 4.6.25",
"hashtags": [],
"url": "ttps://www.instagram.com/p/DGR-uEoRrfg/",
"comments_count": 35491,
"likes_count": 1538960,
"view_count": 7959651,
"play_count": 22863362,
"upload_date": "2025-02-20",
"author": {
"username": "beyonce",
"name": "Beyoncé",
"id": "247944034",
"profile_picture_url": null
},
"tagged_users": null,
"media": [
{
"type": "video",
"thumbnail_url": "https://instagram.frmq2-2.fna.fbcdn.net/v/t51.2885-15/480746587_18537356002008035_6860679811123102568_n.jpg?stp=dst-jpg_e35_p1080x1080_sh0.08_tt6&_nc_ht=instagram.frmq2-2.fna.fbcdn.net&_nc_cat=111&_nc_oc=Q6cZ2QGh_YTQRa7YJx7TXNWwGCG_WRCkqBC5rROfnmfbo4lrTB9fjRmeCHcZpmaKPz5bMI8&_nc_ohc=3oaLKauBkcAQ7kNvgE7RqbQ&_nc_gid=1vwAb-gaOPNNKKRihstv-Q&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYHsrTwVUDz7fiIVrVg-YVduKnWKKRmpNYRfuhVtiRs01Q&oe=67F1F725&_nc_sid=10d13b",
"url": "https://scontent.cdninstagram.com/o1/v/t16/f2/m86/AQPPw1RtmAJ_c3YWM5w35QXL8aZPZDxl9cOpOL96mjqdw8B2E7Hry9Q8wTal6-_gilVCr3pisIjjS_fHxSzPyPcqPg0VSMkRa9Itoks.mp4?stp=dst-mp4&efg=eyJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSIsInZlbmNvZGVfdGFnIjoidnRzX3ZvZF91cmxnZW4uY2xpcHMuYzIuNzIwLmJhc2VsaW5lIn0&_nc_cat=103&vs=950010947115910_3300839751&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC9ERjQxMEQwQzMwQTlDRTdFOUFCMjlERUQ5N0VBNUY5N192aWRlb19kYXNoaW5pdC5tcDQVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dIZHZneHhoUmlkU0hDOEVBT2VoOV9MekxuVlNicV9FQUFBRhUCAsgBACgAGAAbABUAACaQz%2BD%2B6Pz7PxUCKAJDMywXQDGiDEm6XjUYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=f7c64edac6&ccb=9-4&oh=00_AYFHgJ7wsx7Op7pGxg7kdlaxsd8lggo7zLsaYUpEbWz8DQ&oe=67EDFCE7&_nc_sid=10d13b",
"id": null,
}
],
"created_at": "2025-03-21T00:08:07.793135Z",
"updated_at": "2025-03-21T00:08:07.793136Z",
},
...
],
"summary": null,
"pagination": null
}