API quickstart
Pinchana API is a parent orchestration repository with Git submodules. Clone it recursively.
git clone --recurse-submodules https://github.com/Pinchana/pinchana-api.gitcd pinchana-apicp .env.example .envchmod 600 .envProduction minimum
Section titled “Production minimum”The production Compose stack routes scraper traffic through Gluetun. Configure a WireGuard key and at least one independently revocable machine API key:
WIREGUARD_PRIVATE_KEY=REPLACE_WITH_PROVIDER_WIREGUARD_PRIVATE_KEYPINCHANA_API_KEYS={"automation":"REPLACE_WITH_LONG_RANDOM_MACHINE_KEY"}Spotify additionally requires:
SPOTIFY_CLIENT_ID=REPLACE_WITH_CLIENT_IDSPOTIFY_CLIENT_SECRET=REPLACE_WITH_CLIENT_SECRETIf you are deploying Pinchana Web against this API, configure the separate Turnstile/browser-session values described in Authentication.
Pin coherent release images
Section titled “Pin coherent release images”Do not deploy a mixture of mutable stable tags. Resolve the newest coherent release and write immutable digests into .env:
python scripts/update_rolling.py --env-file .env --dry-runpython scripts/update_rolling.py --env-file .envThe default updater advances the gateway and normal scraper images. Add --dlp only when the DLP profile should advance as part of the same release:
python scripts/update_rolling.py --env-file .env --dlp --dry-runpython scripts/update_rolling.py --env-file .env --dlpStart the API
Section titled “Start the API”docker compose --env-file .env config --quietdocker compose --env-file .env up --detachdocker compose --env-file .env psCheck the gateway:
curl --fail-with-body --silent --show-error http://127.0.0.1:8080/healthCall API v1
Section titled “Call API v1”curl --fail-with-body --silent --show-error \ --request POST http://127.0.0.1:8080/v1/scrape \ --header 'Content-Type: application/json' \ --header 'X-API-Key: REPLACE_WITH_MACHINE_KEY' \ --data '{"url":"https://www.instagram.com/p/REPLACE_WITH_PUBLIC_SHORTCODE/"}'A successful response uses the normalized shape:
{ "data": { "id": "...", "source": {"platform": "instagram", "url": "https://...", "application": null}, "content": {"title": null, "text": "...", "html": null, "published_at": null}, "author": {"name": "...", "username": "..."}, "media": [] }, "meta": {"api_version": "1"}}The API can add optional music, engagement, safety, and link metadata. Downloadable assets are always represented in the ordered data.media list.
Development stack
Section titled “Development stack”For local source development without production VPN credentials:
docker compose --env-file .env -f docker-compose.dev.yml up --detach --buildThe development Compose file uses normal bridge networking and direct service ports instead of sharing Gluetun’s namespace.
Next: Authentication, Endpoint reference, and Schemas.