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
- Validate and normalize the submitted Instagram URL.
- Fetch the canonical post document with browser-compatible navigation headers and extract its embedded Relay media payload.
- If the initial document has no media, discover the current persisted operation from
expectedPreloaders; scan referenced Relay bundles only when that metadata is absent. - Classify Instagram's HTTP-200 internal 404 and explicit route restrictions before treating an empty anonymous surface as ambiguous.
- Rotate the Gluetun connection and retry within the bounded policy only after request-level
401,403,429, or timeout evidence. - 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 /scrapeaccepts{"url":"https://www.instagram.com/p/SHORTCODE/"}.GET /healthreports 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.11.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pinchana_inst-26.11.15.tar.gz | 14.5 kB | With provenance | Details for pinchana_inst-26.11.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pinchana_inst-26.11.15-py3-none-any.whl | Python 3 | none | any | Details for pinchana_inst-26.11.15-py3-none-any.whl |
Total release size: 31.2 kB
Release files / pinchana_inst-26.11.15.tar.gz
| Download URL | pinchana_inst-26.11.15.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0656798eaaf117fa4e59e112619c3f0bb2e4d2f82090b5c2f7c269ec422f9456
|
|
BLAKE2b-256 checksum How to use checksums |
4a0cf9cf1f4b022a9d5fdbe715c0257cf3d4e2aebb25396728dead3a1b4f5c91
|
| 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 Nov 26, 2026.
Transparency logRelease files / pinchana_inst-26.11.15-py3-none-any.whl
| Download URL | pinchana_inst-26.11.15-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0766d2258299832ed6a8707ebdedd47a0339125d0df0971da9bc548631f09e3b
|
|
BLAKE2b-256 checksum How to use checksums |
a328b50da61d7643635d73c6a5c79620109cc582cfe7ebff2802b3530a43d0aa
|
| 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 Nov 26, 2026.
Transparency logSecurity for pinchana-inst 26.11.15
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.
Attestation for pinchana_inst-26.11.15.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 Nov 26, 2026.
Transparency logA 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.