API quickstart
Machine clients send a JSON URL to POST https://api.pinchana.cc/scrape and authenticate with X-API-Key. Ask the API operator for a named key; do not put machine keys in browser code.
curl --fail-with-body https://api.pinchana.cc/scrape \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-API-Key: YOUR_API_KEY' \ --data '{"url":"https://www.instagram.com/p/SHORTCODE/"}'const response = await fetch('https://api.pinchana.cc/scrape', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': process.env.PINCHANA_API_KEY, }, body: JSON.stringify({ url: 'https://www.instagram.com/p/SHORTCODE/' }),});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);const result = await response.json();console.log(result.media_type, result.video_url ?? result.thumbnail_url);import osimport httpx
response = httpx.post( "https://api.pinchana.cc/scrape", headers={"X-API-Key": os.environ["PINCHANA_API_KEY"]}, json={"url": "https://www.instagram.com/p/SHORTCODE/"}, timeout=120,)response.raise_for_status()result = response.json()print(result["media_type"], result.get("video_url") or result["thumbnail_url"])- Store the key in a server-side secret such as
PINCHANA_API_KEY. - Submit a supported, complete HTTP(S) URL. Scraping and upstream media downloads can take time; use a client timeout near the gateway’s 120-second forwarding timeout.
- Join relative media paths to the API origin and fetch them with the same
X-API-Key.
curl --fail --location \ --header 'X-API-Key: YOUR_API_KEY' \ --output media.mp4 \ 'https://api.pinchana.cc/media/instagram/SHORTCODE/video.mp4'