Skip to main content

Pinchana Instagram

This FastAPI module extracts public Instagram posts and Reels through Instagram's anonymous first-party web surfaces. It downloads images, videos, and ordered carousels into the shared Pinchana cache.

Processing flow

  1. Validate and normalize the submitted Instagram URL.
  2. Fetch the canonical post document with browser-compatible navigation headers and extract its embedded Relay media payload.
  3. If the initial document has no media, discover the current persisted operation from expectedPreloaders; scan referenced Relay bundles only when that metadata is absent.
  4. Classify Instagram's HTTP-200 internal 404 and explicit route restrictions before treating an empty anonymous surface as ambiguous.
  5. Rotate the Gluetun connection and retry within the bounded policy only after request-level 401, 403, 429, or timeout evidence.
  6. Download media and store it under /app/cache/instagram/{shortcode} in containers.

Deleted posts return not_found; explicit route gates return restricted_media; anonymous misses without decisive evidence return anonymous_unavailable. The latter deliberately does not guess whether a post is private, login-only, expired, or otherwise unavailable.

API

  • POST /scrape accepts {"url":"https://www.instagram.com/p/SHORTCODE/"}.
  • GET /health reports module and VPN readiness.

External clients should use the gateway's authenticated POST /v1/scrape route.

Configuration

Variable Default Purpose
CACHE_PATH ./cache Base media cache path
CACHE_MAX_SIZE_GB 10.0 Maximum cache size before oldest-post eviction
GLUETUN_CONTROL_URL http://localhost:8000 Private Gluetun control endpoint

Development and validation

uv sync --frozen
uv run uvicorn pinchana_inst.main:app --host 0.0.0.0 --port 8082 --reload
uv run pytest -q
PINCHANA_INST_LIVE=1 uv run pytest -q

Live tests contact Instagram and are opt-in. Build the image from the parent repository so pinchana-core is available:

docker build --file scrapers/pinchana-inst/Dockerfile --tag pinchana-inst:local .

Metadata

Release files for pinchana-inst 26.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinchana-inst 26.12.1
File Size Uploaded Provenance Actions
pinchana_inst-26.12.1.tar.gz 14.5 kB With provenance Details for pinchana_inst-26.12.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pinchana-inst 26.12.1
File Interpreter ABI Platform Actions
pinchana_inst-26.12.1-py3-none-any.whl Python 3 none any Details for pinchana_inst-26.12.1-py3-none-any.whl

Total release size: 31.1 kB

Release files / pinchana_inst-26.12.1.tar.gz

Download URL pinchana_inst-26.12.1.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7415fb8d6abc78732583d33d8f59e4a7a16c76a0518e0136b1f09de217193971
BLAKE2b-256 checksum
How to use checksums
6af95fc935e8531444f7bc97da2a6fbd393e7efedbd398951ba0c10a429dcd7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / pinchana_inst-26.12.1-py3-none-any.whl

Download URL pinchana_inst-26.12.1-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6718d4cd8c19ce8c5a4c347d0ce1b3526bad03bb32ce2132d6d64f5d5a3a1d0
BLAKE2b-256 checksum
How to use checksums
594cf589aae96eeeb84aaeff15c49016b8f4f87da3bd502136634313206e85a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for pinchana-inst 26.12.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pinchana_inst-26.12.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page