Instagram post & reel metrics API
Fetch the public metrics and available caption or media metadata for a single Instagram post or reel URL. Use it to inspect a particular post after discovering it in a profile feed.
Make a request
GET /instagram/stats accepts query parameters. POST /instagram/stats accepts the same inputs as JSON. Send your project key in the x-access-key header; keep it on your server.
Credits: 1 credit per successful post lookup.
curl request example
curl --fail-with-body --get 'https://api.fetchfox.net/instagram/stats' \
-H 'x-access-key: YOUR_KEY' \
--data-urlencode 'url=https://www.instagram.com/p/POST_ID/'JavaScript request example
// Run on your server with FETCHFOX_API_KEY set.
const url = new URL('https://api.fetchfox.net/instagram/stats');
url.searchParams.set('url', 'https://www.instagram.com/p/POST_ID/');
const response = await fetch(url, {
headers: { 'x-access-key': process.env.FETCHFOX_API_KEY },
signal: AbortSignal.timeout(130000)
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const result = await response.json();
if (!result.success) throw new Error('Request unsuccessful');
console.log(result.data);Python request example
import json, os
from urllib.parse import urlencode
from urllib.request import Request, urlopen
query = urlencode({"url":"https://www.instagram.com/p/POST_ID/"})
request = Request('https://api.fetchfox.net/instagram/stats?' + query,
headers={'x-access-key': os.environ['FETCHFOX_API_KEY']})
with urlopen(request, timeout=130) as response:
result = json.load(response)
if not result.get('success'):
raise RuntimeError('Request unsuccessful')
print(result['data'])Replace placeholder source IDs with real public URLs. See limits and retries before automating calls.
Optional views versus required views
By default, requireViews is false. The API can return available media and metrics even if verified video views are unavailable; unavailable views remain null. Image and carousel view counts are also null because that metric is not applicable. Null is not a zero-view count.
Set requireViews=true only when a verified video view count is essential. If strict recovery cannot find a verified count, the request returns HTTP 503 without a processing charge. Operational rate and daily safety limits still apply.
Record one observation per request
Save the original post URL, retrieval time, and returned metrics together. Public metrics can change between reads. Build historical comparisons from your own snapshots rather than treating one response as a time series.
Read the comments behind the count
A public comment count is not the comment text. Use the separate comments endpoint or browser viewer to retrieve an available comment batch.