Get Media
curl --request GET \
--url https://scrapebadger.com/v1/instagram/media/{code} \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/instagram/media/{code}"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/instagram/media/{code}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/instagram/media/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/instagram/media/{code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/instagram/media/{code}")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/instagram/media/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"media": {
"pk": "<string>",
"id": "<string>",
"code": "<string>",
"taken_at": "<string>",
"taken_at_utc": 123,
"media_type": 123,
"product_type": "<string>",
"caption_text": "<string>",
"like_count": 123,
"comment_count": 123,
"play_count": 123,
"view_count": 123,
"video_url": "<string>",
"thumbnail_url": "<string>",
"url": "<string>",
"user": {},
"usertags": [
{}
],
"coauthor_producers": [
{}
],
"location": {},
"resources": [
{}
],
"hashtags": [
"<string>"
],
"mentions": [
"<string>"
]
}
}Endpoints
Get Media
Full media detail by shortcode — photo, video, reel or carousel — with caption, counts, resources, usertags and location. Plus oEmbed.
GET
/
v1
/
instagram
/
media
/
{code}
Get Media
curl --request GET \
--url https://scrapebadger.com/v1/instagram/media/{code} \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/instagram/media/{code}"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/instagram/media/{code}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/instagram/media/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/instagram/media/{code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/instagram/media/{code}")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/instagram/media/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"media": {
"pk": "<string>",
"id": "<string>",
"code": "<string>",
"taken_at": "<string>",
"taken_at_utc": 123,
"media_type": 123,
"product_type": "<string>",
"caption_text": "<string>",
"like_count": 123,
"comment_count": 123,
"play_count": 123,
"view_count": 123,
"video_url": "<string>",
"thumbnail_url": "<string>",
"url": "<string>",
"user": {},
"usertags": [
{}
],
"coauthor_producers": [
{}
],
"location": {},
"resources": [
{}
],
"hashtags": [
"<string>"
],
"mentions": [
"<string>"
]
}
}Fetch a single piece of media by its shortcode
code (the token in a
/p/…, /reel/… or /tv/… URL). An oembed variant returns Instagram’s
embed payload.
Credits: 5 (media detail) · 2 (oembed)
Authorization
string
required
Your ScrapeBadger API key.
Path Parameters
string
required
Media shortcode, e.g.
C8xYzAbCdE1.Related paths
GET /v1/instagram/media/{code}/oembed— Instagram oEmbed payload. 2 credits.
Response
object
The full
Media. Key fields:Show media
Show media
string
string
string
Shortcode.
string
ISO 8601 UTC.
integer
Unix seconds.
integer
1 = photo, 2 = video, 8 = carousel.
string
e.g.
feed, clips (reel), igtv, carousel_container.string
integer
integer
integer
integer
string
string
string
object
Author
UserShort.object[]
Tagged users + position.
object[]
Collab co-authors.
object
pk, name, lat, lng.object[]
Carousel / multi-resource children.
string[]
Parsed from the caption.
string[]
Parsed from the caption.
Example
curl "https://scrapebadger.com/v1/instagram/media/C8xYzAbCdE1" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/instagram/media/C8xYzAbCdE1",
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const { media } = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/instagram/media/C8xYzAbCdE1",
headers={"X-API-Key": "YOUR_API_KEY"},
)
media = res.json()["media"]
Response
{
"media": {
"pk": "3401234567890123456",
"id": "3401234567890123456_25025320",
"code": "C8xYzAbCdE1",
"taken_at": "2026-07-30T18:04:11Z",
"taken_at_utc": 1785434651,
"media_type": 2,
"product_type": "clips",
"caption_text": "Summer on Instagram. #summer @friend",
"like_count": 1240553,
"comment_count": 8842,
"play_count": 9820114,
"view_count": 9820114,
"video_url": "https://scontent.cdninstagram.com/v/reel.mp4",
"thumbnail_url": "https://scontent.cdninstagram.com/v/thumb.jpg",
"url": "https://www.instagram.com/reel/C8xYzAbCdE1/",
"user": { "pk": "25025320", "username": "instagram", "is_verified": true },
"usertags": [{ "user": { "username": "friend" }, "x": 0.5, "y": 0.5 }],
"coauthor_producers": [],
"location": { "pk": "213385402", "name": "New York, New York", "lat": 40.7128, "lng": -74.006 },
"resources": [],
"hashtags": ["summer"],
"mentions": ["friend"],
"scraped_at": "2026-08-05T12:00:00Z"
}
}
⌘I

