Instagram URL Parser API — Resolve Any Link (Free)

Parse an Instagram URL (free)

Turns any Instagram link into the fields the other routes take: what it points to — a post, reel, account, story, hashtag or place — and the short code, id or username it carries. Use it before choosing a route. Free: it costs no credit.

POST /resolve-url Utilities
https://api.fetchlayer.dev/instagram/resolve-url
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Any Instagram link: a post, a reel, an account, a hashtag or a place. A link to something Instagram does not make public, such as a hashtag page or a place, is still identified, with a note saying it is not available — the cheapest way to find that out.

format string optional

json or markdown, lowercase; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON. (default: json)

timeoutMs integer optional

Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs.

Response Fields

resolve-url

Parse an Instagram URL (free)

transport string

The data source: always the platform id, "instagram".

notes string[]

Caveats you can act on — a ceiling Instagram imposes, a counter it withholds, a list that stopped early. Several real limits are reported only here, so read them. An empty result always comes with a note explaining it, never as an unexplained empty array.

pagesFetched number

Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed.

kind string

One of post, reel, profile, hashtag, location, story, explore or unknown. A highlight link (/stories/highlights/<id>/) is story, with no username. A share link (/share/…) does not say which post it points to, so it is unknown, with a note to open it and pass the link it lands on; a sound or audio page is unknown too.

canonicalUrl string

The link in its canonical form, or null.

username string

The account handle, when the link carries one. A post link that includes the account (/<username>/p/<code>/) returns both username and shortcode.

shortcode string

The post or reel short code, when the link points at one.

postId string

The numeric media id, when it can be decoded from the short code.

hashtagName string

The tag, when the link points at a hashtag. Posts under a hashtag are not available — the note says so.

locationId string

The place id, when the link points at a location. Posts at a place are not available either.

Request

curl -X POST "https://api.fetchlayer.dev/instagram/resolve-url" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.instagram.com/p/DcOX3hWFiey/"}'

Response

{
  "transport": "instagram",
  "notes": [],
  "pagesFetched": 0,
  "kind": "post",
  "canonicalUrl": "https://www.instagram.com/p/DcOX3hWFiey/",
  "username": null,
  "shortcode": "DcOX3hWFiey",
  "postId": "3967213292204992434",
  "hashtagName": null,
  "locationId": null
}
Product overviewInstagram API: what it returns, pricing and use cases