herascrape
API reference

Utility

Id conversion, share-link resolution, balance and health.

Four endpoints that support the rest. All four are free — none of them costs a billed Instagram request.

pk ⇄ shortcode

Converts a media pk to its shortcode and back. Pass exactly one of pk or code.

GET /resolve/media?code=B4XpqViUFUI
{ "pk": "2168384974851429640", "code": "B4XpqViUFUI" }

Free and instant: the shortcode is base64 of the pk over Instagram's alphabet, so this is arithmetic done locally with no network call. You rarely need it — /posts/{id} accepts either form directly — but it is useful for normalising ids before storing them.

Query Parameters

pk?|

Numeric media pk

code?|

Media shortcode

GET
/resolve/media
curl -X GET "https://example.com/resolve/media"
{}
{}

What comes back

The { pk, code } pair shown above — the only response on the API we define ourselves, because it is computed rather than proxied.

Two jobs in one endpoint, because Instagram serves both from the same place.

For a post or reel URL, you get the oEmbed block — title, author, thumbnail, embed HTML.

For a /s/ share link, you get what it points at: reel_id, author_id and can_view. That is how you turn a shared story or highlight link into something you can fetch:

GET /oembed?url=https://instagram.com/s/aGlnaGxpZ2h0OjE4MDI...
# -> { "reel_id": "highlight:18021...", "author_id": "25025320", ... }
GET /highlights/18021...

Query Parameters

url*Url

Post/reel URL, or a /s/ share link

GET
/oembed
curl -X GET "https://example.com/oembed?url=string"
{}
{}

What comes back

{
  "author_id": "25025320",
  "author_name": "instagram",
  "reel_id": "highlight:18021...",
  "media_id": null,
  "can_view": true,
  "title": "A caption",
  "html": "<blockquote class=\"instagram-media\">…</blockquote>",
  "thumbnail_url": "https://scontent.cdninstagram.com/..."
}

A post URL populates title / html / thumbnail_url; a /s/ share link populates reel_id / author_id / can_view. The unused half is null.

Balance

Your account's remaining USD balance, read live from the ledger, so a top-up shows up immediately.

GET
/system/balance
curl -X GET "https://example.com/system/balance"
{}

What comes back

{ "balance_usd": "12.4832", "currency": "USD" }

A string, not a number — money must not round-trip through binary floating point.

Health

Liveness. The only endpoint that needs no API key, so it is safe to use as an uptime probe.

GET
/system/health
curl -X GET "https://example.com/system/health"
{
  "property1": "string",
  "property2": "string"
}

What comes back

{ "status": "ok" }

Errors

CodeWhen
invalid_parameterNeither pk nor code given, both given, or the value will not convert.
unprocessable_entityurl missing.
not_foundThe URL points at something deleted.

On this page