instagram-edits-sdk 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- instagram_edits_sdk-0.2.1/.github/workflows/publish.yml +59 -0
- instagram_edits_sdk-0.2.1/.github/workflows/tests.yml +21 -0
- instagram_edits_sdk-0.2.1/CHANGELOG.md +29 -0
- instagram_edits_sdk-0.2.1/CONTRIBUTING.md +22 -0
- instagram_edits_sdk-0.2.1/LICENSE +26 -0
- instagram_edits_sdk-0.2.1/MANIFEST.in +7 -0
- instagram_edits_sdk-0.2.1/PKG-INFO +108 -0
- instagram_edits_sdk-0.2.1/PYPI_README.md +87 -0
- instagram_edits_sdk-0.2.1/README.en.md +80 -0
- instagram_edits_sdk-0.2.1/README.md +140 -0
- instagram_edits_sdk-0.2.1/REPOSITORY.md +30 -0
- instagram_edits_sdk-0.2.1/SECURITY.md +13 -0
- instagram_edits_sdk-0.2.1/docs/authentication.md +113 -0
- instagram_edits_sdk-0.2.1/docs/data-reference.md +174 -0
- instagram_edits_sdk-0.2.1/docs/evidence/live-verification.json +40 -0
- instagram_edits_sdk-0.2.1/docs/evidence/method-verification.json +146 -0
- instagram_edits_sdk-0.2.1/docs/evidence/package-validation.json +20 -0
- instagram_edits_sdk-0.2.1/docs/evidence/pypi-release-validation.json +16 -0
- instagram_edits_sdk-0.2.1/docs/http-api.md +107 -0
- instagram_edits_sdk-0.2.1/docs/integration.md +80 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselAccountLevelInsightsQuery.md +42 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselAccountLevelReelsQuery.md +44 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselAudienceInsightsQuery.md +42 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselKitClearDefaultMutation.md +30 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselKitCreateMutation.md +30 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselKitDeleteMutation.md +30 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselKitSetDefaultMutation.md +30 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselKitUpdateMutation.md +30 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselKitsQuery.md +38 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselPublicInsightsQuery.md +38 -0
- instagram_edits_sdk-0.2.1/docs/methods/BaselReelDetailsQuery.md +44 -0
- instagram_edits_sdk-0.2.1/docs/methods/ReelInsightsQuery.md +43 -0
- instagram_edits_sdk-0.2.1/docs/methods/XIGBaselAccountLevelReelsDataDeltaQuery.md +38 -0
- instagram_edits_sdk-0.2.1/docs/methods/XIGBaselInsightsCommentsQuery.md +40 -0
- instagram_edits_sdk-0.2.1/docs/methods/XIGBaselInsightsRetentionSummaryMutation.md +30 -0
- instagram_edits_sdk-0.2.1/docs/methods.md +120 -0
- instagram_edits_sdk-0.2.1/docs/openapi.json +827 -0
- instagram_edits_sdk-0.2.1/docs/releasing.md +70 -0
- instagram_edits_sdk-0.2.1/docs/retention.md +83 -0
- instagram_edits_sdk-0.2.1/docs/swagger/index.html +35 -0
- instagram_edits_sdk-0.2.1/docs/swagger/vendor/LICENSE +202 -0
- instagram_edits_sdk-0.2.1/docs/swagger/vendor/NOTICE +2 -0
- instagram_edits_sdk-0.2.1/docs/swagger/vendor/provenance.json +22 -0
- instagram_edits_sdk-0.2.1/docs/swagger/vendor/swagger-ui-bundle.js +2 -0
- instagram_edits_sdk-0.2.1/docs/swagger/vendor/swagger-ui-bundle.js.LICENSE.txt +131 -0
- instagram_edits_sdk-0.2.1/docs/swagger/vendor/swagger-ui.css +3 -0
- instagram_edits_sdk-0.2.1/docs/swagger/viewer.js +53 -0
- instagram_edits_sdk-0.2.1/docs/swagger.md +37 -0
- instagram_edits_sdk-0.2.1/docs/verification.md +104 -0
- instagram_edits_sdk-0.2.1/examples/account_statistics.py +24 -0
- instagram_edits_sdk-0.2.1/examples/batch_retention.py +36 -0
- instagram_edits_sdk-0.2.1/examples/extended_insights.py +27 -0
- instagram_edits_sdk-0.2.1/examples/list_reels.py +25 -0
- instagram_edits_sdk-0.2.1/examples/offline_demo.py +26 -0
- instagram_edits_sdk-0.2.1/examples/read_operation.py +35 -0
- instagram_edits_sdk-0.2.1/examples/reel_statistics.py +20 -0
- instagram_edits_sdk-0.2.1/examples/retention.py +22 -0
- instagram_edits_sdk-0.2.1/pyproject.toml +34 -0
- instagram_edits_sdk-0.2.1/setup.cfg +4 -0
- instagram_edits_sdk-0.2.1/src/edits_api/__init__.py +8 -0
- instagram_edits_sdk-0.2.1/src/edits_api/__main__.py +3 -0
- instagram_edits_sdk-0.2.1/src/edits_api/_wire.py +467 -0
- instagram_edits_sdk-0.2.1/src/edits_api/cli.py +56 -0
- instagram_edits_sdk-0.2.1/src/edits_api/client.py +317 -0
- instagram_edits_sdk-0.2.1/src/edits_api/operations.json +15117 -0
- instagram_edits_sdk-0.2.1/src/edits_api/registry.py +25 -0
- instagram_edits_sdk-0.2.1/src/instagram_edits_sdk.egg-info/PKG-INFO +108 -0
- instagram_edits_sdk-0.2.1/src/instagram_edits_sdk.egg-info/SOURCES.txt +75 -0
- instagram_edits_sdk-0.2.1/src/instagram_edits_sdk.egg-info/dependency_links.txt +1 -0
- instagram_edits_sdk-0.2.1/src/instagram_edits_sdk.egg-info/entry_points.txt +2 -0
- instagram_edits_sdk-0.2.1/src/instagram_edits_sdk.egg-info/top_level.txt +1 -0
- instagram_edits_sdk-0.2.1/tests/fixtures/reel_details.synthetic.json +19 -0
- instagram_edits_sdk-0.2.1/tests/test_client.py +240 -0
- instagram_edits_sdk-0.2.1/tests/test_wire.py +208 -0
- instagram_edits_sdk-0.2.1/tools/check_release.py +62 -0
- instagram_edits_sdk-0.2.1/tools/generate_docs.py +89 -0
- instagram_edits_sdk-0.2.1/tools/generate_openapi.py +92 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- 'v*'
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
13
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
14
|
+
with:
|
|
15
|
+
python-version: '3.14'
|
|
16
|
+
- name: Check version matches the release tag
|
|
17
|
+
env:
|
|
18
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
19
|
+
run: |
|
|
20
|
+
python - <<'PY'
|
|
21
|
+
import os, tomllib
|
|
22
|
+
project = tomllib.load(open('pyproject.toml', 'rb'))['project']
|
|
23
|
+
assert project['name'] == 'instagram-edits-sdk'
|
|
24
|
+
assert os.environ['RELEASE_TAG'] == 'v' + project['version']
|
|
25
|
+
PY
|
|
26
|
+
- run: python -m pip install . build twine
|
|
27
|
+
- run: python -m unittest discover -s tests -v
|
|
28
|
+
- run: python examples/offline_demo.py
|
|
29
|
+
- run: python tools/generate_docs.py --check
|
|
30
|
+
- run: python tools/generate_openapi.py --check
|
|
31
|
+
- run: python tools/check_release.py
|
|
32
|
+
- run: python -m build
|
|
33
|
+
- run: python -m twine check --strict dist/*
|
|
34
|
+
- name: Test the actual wheel without runtime dependencies
|
|
35
|
+
run: |
|
|
36
|
+
python -m venv /tmp/edits-wheel-check
|
|
37
|
+
/tmp/edits-wheel-check/bin/python -m pip install --no-deps dist/*.whl
|
|
38
|
+
/tmp/edits-wheel-check/bin/python -m unittest discover -s tests -v
|
|
39
|
+
/tmp/edits-wheel-check/bin/python examples/offline_demo.py
|
|
40
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
41
|
+
with:
|
|
42
|
+
name: python-distributions
|
|
43
|
+
path: dist/*
|
|
44
|
+
if-no-files-found: error
|
|
45
|
+
publish:
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/p/instagram-edits-sdk
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
55
|
+
with:
|
|
56
|
+
name: python-distributions
|
|
57
|
+
path: dist/
|
|
58
|
+
- name: Publish the verified distributions
|
|
59
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Python checks
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
jobs:
|
|
6
|
+
tests:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
python: ["3.10", "3.12", "3.14"]
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
13
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
14
|
+
with:
|
|
15
|
+
python-version: ${{ matrix.python }}
|
|
16
|
+
- run: python -m pip install .
|
|
17
|
+
- run: python -m unittest discover -s tests -v
|
|
18
|
+
- run: python examples/offline_demo.py
|
|
19
|
+
- run: python tools/generate_docs.py --check
|
|
20
|
+
- run: python tools/generate_openapi.py --check
|
|
21
|
+
- run: python tools/check_release.py
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.1 β 2026-10-18
|
|
4
|
+
|
|
5
|
+
- Rename the distribution to `instagram-edits-sdk` for PyPI; the `edits_api` import and `edits-api` CLI stay unchanged.
|
|
6
|
+
- Add an English PyPI description, project links and bundled license metadata.
|
|
7
|
+
- Add a tag-triggered build and publish workflow using PyPI Trusted Publishing.
|
|
8
|
+
- Runtime API and observed live-query evidence remain unchanged from 0.2.0.
|
|
9
|
+
|
|
10
|
+
## 0.2.0 β 2026-10-18
|
|
11
|
+
|
|
12
|
+
- Preserve Reel statistics when retention is missing, null, empty, or all-null.
|
|
13
|
+
- Add `insights` CLI, canonical path resolution, and typed cursor pages.
|
|
14
|
+
- Exercise nine read operations plus a second Reel page against the live API.
|
|
15
|
+
- Distinguish populated responses from null comment analysis and empty Kits.
|
|
16
|
+
- Recover period and comment-sort enums; add all-method examples and local Swagger.
|
|
17
|
+
- Keep live evidence sanitized and private responses outside the repository.
|
|
18
|
+
|
|
19
|
+
## 0.1.0 β 2026-10-18
|
|
20
|
+
|
|
21
|
+
- Package the original live-verified retention transport as an importable client.
|
|
22
|
+
- Parse standard and observed canonical field names; preserve null and zero.
|
|
23
|
+
- Add ownership checks, explicit JSON/CSV/SVG exports and a CLI.
|
|
24
|
+
- Document HTTP/authentication, seven analytics wrappers and 15 detailed contracts.
|
|
25
|
+
- Include a versioned 88-operation Edits index and 1663-entry shared registry.
|
|
26
|
+
- Add synthetic tests, offline demo, release checks and GitHub Actions.
|
|
27
|
+
|
|
28
|
+
Only the original BaselReelDetailsQuery exchange is server-verified. Other
|
|
29
|
+
operations remain static findings. No private responses or credentials are shipped.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Keep evidence levels explicit. A registry entry or a passing mock test must not
|
|
4
|
+
be labelled as a live-verified server contract. Record APK version, operation ID,
|
|
5
|
+
request variables, response schema, date and limits for a new finding.
|
|
6
|
+
|
|
7
|
+
Do not submit cookies, Authorization headers, passwords, HAR captures, real
|
|
8
|
+
personal response dumps, APK binaries, decompiled Meta source, or copied media.
|
|
9
|
+
Fixtures must be clearly synthetic. Keep request examples read-only by default.
|
|
10
|
+
|
|
11
|
+
Before submitting:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
python -m pip install -e .
|
|
15
|
+
python -m unittest discover -s tests -v
|
|
16
|
+
python examples/offline_demo.py
|
|
17
|
+
python tools/generate_docs.py --check
|
|
18
|
+
python tools/check_release.py
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
CI must never call Instagram. Real verification needs an explicitly authorized
|
|
22
|
+
account, and should publish only a sanitized evidence record.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Instagram Edits API Research contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
This license applies to original code and documentation in this repository.
|
|
24
|
+
Instagram, Edits, Meta, and their trademarks are owned by their respective owners.
|
|
25
|
+
No Meta APKs, decompiled sources, media, credentials, or private response dumps
|
|
26
|
+
are distributed with this repository.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
include README.md README.en.md PYPI_README.md LICENSE CONTRIBUTING.md SECURITY.md CHANGELOG.md REPOSITORY.md
|
|
2
|
+
recursive-include docs *.md *.json *.html *.css *.js *.txt LICENSE NOTICE
|
|
3
|
+
recursive-include examples *.py
|
|
4
|
+
recursive-include tests *.py *.json
|
|
5
|
+
recursive-include tools *.py
|
|
6
|
+
recursive-include .github *.yml
|
|
7
|
+
global-exclude __pycache__ *.py[cod]
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: instagram-edits-sdk
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Unofficial, evidence-based Instagram Edits API research client
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/lupikovoleg/instagram-edits-sdk
|
|
7
|
+
Project-URL: Documentation, https://github.com/lupikovoleg/instagram-edits-sdk#readme
|
|
8
|
+
Project-URL: Repository, https://github.com/lupikovoleg/instagram-edits-sdk
|
|
9
|
+
Project-URL: Issues, https://github.com/lupikovoleg/instagram-edits-sdk/issues
|
|
10
|
+
Keywords: instagram,edits,reels,analytics,retention,sdk
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
License-File: docs/swagger/vendor/LICENSE
|
|
18
|
+
License-File: docs/swagger/vendor/NOTICE
|
|
19
|
+
License-File: docs/swagger/vendor/swagger-ui-bundle.js.LICENSE.txt
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Instagram Edits SDK
|
|
23
|
+
|
|
24
|
+
Unofficial Python SDK for Instagram Edits: Reel statistics, audience analytics,
|
|
25
|
+
retention curves, and documented internal GraphQL operations. Not affiliated with Meta.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python -m pip install instagram-edits-sdk
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Python 3.10 or newer. No runtime dependencies. The Python import is `edits_api`;
|
|
34
|
+
the command-line entry point is `edits-api`.
|
|
35
|
+
|
|
36
|
+
If you installed the earlier local distribution `instagram-edits-research`,
|
|
37
|
+
uninstall it before installing this package: both provide the same import module.
|
|
38
|
+
|
|
39
|
+
## Quickstart
|
|
40
|
+
|
|
41
|
+
Supply `IG_SESSIONID` through your backend's environment or secret manager.
|
|
42
|
+
Use the Instagram session of the Reel owner. Do not embed it in frontend code.
|
|
43
|
+
The SDK uses an existing session; it does not log in or obtain browser cookies.
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from edits_api import EditsClient
|
|
47
|
+
|
|
48
|
+
client = EditsClient.from_env()
|
|
49
|
+
reel = client.reel_insights("https://www.instagram.com/reel/YOUR_SHORTCODE/")
|
|
50
|
+
|
|
51
|
+
plays = reel.metrics.get("play_count")
|
|
52
|
+
likes = reel.metrics.get("like_count")
|
|
53
|
+
|
|
54
|
+
if reel.retention_available:
|
|
55
|
+
points = [{"index": p.index, "percent": p.percent} for p in reel.retention]
|
|
56
|
+
else:
|
|
57
|
+
points = None
|
|
58
|
+
|
|
59
|
+
# Optional: export to a new directory. JSON always; CSV/SVG with available retention.
|
|
60
|
+
reel.export("results/my-reel")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Missing, null, empty, or all-null retention does not discard other Reel metrics.
|
|
64
|
+
`client.retention()` is strict and raises `EditsError` when no curve is available.
|
|
65
|
+
Zero and null are preserved as different values.
|
|
66
|
+
|
|
67
|
+
## Other read methods
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
page = client.reels_page(first=3)
|
|
71
|
+
if page.has_next_page:
|
|
72
|
+
next_page = client.reels_page(first=3, after=page.next_cursor)
|
|
73
|
+
|
|
74
|
+
account = client.account_insights(period="LAST_30_DAYS", include_time_series=True)
|
|
75
|
+
views = account.get_data("xig_user_by_igid_v2", "basel_insights", "reels_views", "value")
|
|
76
|
+
|
|
77
|
+
audience = client.audience_insights(period="LAST_30_DAYS", client_timezone="UTC")
|
|
78
|
+
public_metrics = client.public_insights("YOUR_NUMERIC_MEDIA_ID")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Also available: `account_reels`, `reels_delta`, `comment_insights`, `kits`,
|
|
82
|
+
`extended_reel_insights`, and an explicit `execute` interface. `QueryResult.get_data`
|
|
83
|
+
resolves observed canonical field names; `payload` keeps the original response.
|
|
84
|
+
|
|
85
|
+
## Documentation and evidence
|
|
86
|
+
|
|
87
|
+
- [Authentication and passing session credentials](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/authentication.md)
|
|
88
|
+
- [Data fields and examples for all documented read methods](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/data-reference.md)
|
|
89
|
+
- [Retention example](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/examples/retention.py)
|
|
90
|
+
- [HTTP contract and response handling](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/http-api.md)
|
|
91
|
+
- [Operation catalog](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/methods.md)
|
|
92
|
+
- [OpenAPI and local Swagger viewer](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/swagger.md)
|
|
93
|
+
- [Verification scope](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/verification.md)
|
|
94
|
+
|
|
95
|
+
Nine read operations were exercised on one consenting account on 2026-10-18,
|
|
96
|
+
plus a second page of Reels. Seven returned data; comment analysis was null and
|
|
97
|
+
Kits was empty. Other accounts, every parameter combination, and populated
|
|
98
|
+
comment/Kits results are not verified. The source includes 15 detailed contracts
|
|
99
|
+
and a broader static operation registry, not a claim that all entries work.
|
|
100
|
+
|
|
101
|
+
These are internal, versioned endpoints and can change. No automatic login,
|
|
102
|
+
challenge bypass, session refresh, retries, or unbounded pagination. Mutations
|
|
103
|
+
are untested and require explicit opt-in. Keep credentials private and use only
|
|
104
|
+
accounts and data you are authorized to access.
|
|
105
|
+
|
|
106
|
+
Original SDK and documentation: MIT. The source distribution includes a local
|
|
107
|
+
Swagger UI with its Apache-2.0 license and dependency notices. No APK, decompiled
|
|
108
|
+
Meta source, real session credentials, or private response dumps are included.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Instagram Edits SDK
|
|
2
|
+
|
|
3
|
+
Unofficial Python SDK for Instagram Edits: Reel statistics, audience analytics,
|
|
4
|
+
retention curves, and documented internal GraphQL operations. Not affiliated with Meta.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
python -m pip install instagram-edits-sdk
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Python 3.10 or newer. No runtime dependencies. The Python import is `edits_api`;
|
|
13
|
+
the command-line entry point is `edits-api`.
|
|
14
|
+
|
|
15
|
+
If you installed the earlier local distribution `instagram-edits-research`,
|
|
16
|
+
uninstall it before installing this package: both provide the same import module.
|
|
17
|
+
|
|
18
|
+
## Quickstart
|
|
19
|
+
|
|
20
|
+
Supply `IG_SESSIONID` through your backend's environment or secret manager.
|
|
21
|
+
Use the Instagram session of the Reel owner. Do not embed it in frontend code.
|
|
22
|
+
The SDK uses an existing session; it does not log in or obtain browser cookies.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from edits_api import EditsClient
|
|
26
|
+
|
|
27
|
+
client = EditsClient.from_env()
|
|
28
|
+
reel = client.reel_insights("https://www.instagram.com/reel/YOUR_SHORTCODE/")
|
|
29
|
+
|
|
30
|
+
plays = reel.metrics.get("play_count")
|
|
31
|
+
likes = reel.metrics.get("like_count")
|
|
32
|
+
|
|
33
|
+
if reel.retention_available:
|
|
34
|
+
points = [{"index": p.index, "percent": p.percent} for p in reel.retention]
|
|
35
|
+
else:
|
|
36
|
+
points = None
|
|
37
|
+
|
|
38
|
+
# Optional: export to a new directory. JSON always; CSV/SVG with available retention.
|
|
39
|
+
reel.export("results/my-reel")
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Missing, null, empty, or all-null retention does not discard other Reel metrics.
|
|
43
|
+
`client.retention()` is strict and raises `EditsError` when no curve is available.
|
|
44
|
+
Zero and null are preserved as different values.
|
|
45
|
+
|
|
46
|
+
## Other read methods
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
page = client.reels_page(first=3)
|
|
50
|
+
if page.has_next_page:
|
|
51
|
+
next_page = client.reels_page(first=3, after=page.next_cursor)
|
|
52
|
+
|
|
53
|
+
account = client.account_insights(period="LAST_30_DAYS", include_time_series=True)
|
|
54
|
+
views = account.get_data("xig_user_by_igid_v2", "basel_insights", "reels_views", "value")
|
|
55
|
+
|
|
56
|
+
audience = client.audience_insights(period="LAST_30_DAYS", client_timezone="UTC")
|
|
57
|
+
public_metrics = client.public_insights("YOUR_NUMERIC_MEDIA_ID")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Also available: `account_reels`, `reels_delta`, `comment_insights`, `kits`,
|
|
61
|
+
`extended_reel_insights`, and an explicit `execute` interface. `QueryResult.get_data`
|
|
62
|
+
resolves observed canonical field names; `payload` keeps the original response.
|
|
63
|
+
|
|
64
|
+
## Documentation and evidence
|
|
65
|
+
|
|
66
|
+
- [Authentication and passing session credentials](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/authentication.md)
|
|
67
|
+
- [Data fields and examples for all documented read methods](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/data-reference.md)
|
|
68
|
+
- [Retention example](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/examples/retention.py)
|
|
69
|
+
- [HTTP contract and response handling](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/http-api.md)
|
|
70
|
+
- [Operation catalog](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/methods.md)
|
|
71
|
+
- [OpenAPI and local Swagger viewer](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/swagger.md)
|
|
72
|
+
- [Verification scope](https://github.com/lupikovoleg/instagram-edits-sdk/blob/main/docs/verification.md)
|
|
73
|
+
|
|
74
|
+
Nine read operations were exercised on one consenting account on 2026-10-18,
|
|
75
|
+
plus a second page of Reels. Seven returned data; comment analysis was null and
|
|
76
|
+
Kits was empty. Other accounts, every parameter combination, and populated
|
|
77
|
+
comment/Kits results are not verified. The source includes 15 detailed contracts
|
|
78
|
+
and a broader static operation registry, not a claim that all entries work.
|
|
79
|
+
|
|
80
|
+
These are internal, versioned endpoints and can change. No automatic login,
|
|
81
|
+
challenge bypass, session refresh, retries, or unbounded pagination. Mutations
|
|
82
|
+
are untested and require explicit opt-in. Keep credentials private and use only
|
|
83
|
+
accounts and data you are authorized to access.
|
|
84
|
+
|
|
85
|
+
Original SDK and documentation: MIT. The source distribution includes a local
|
|
86
|
+
Swagger UI with its Apache-2.0 license and dependency notices. No APK, decompiled
|
|
87
|
+
Meta source, real session credentials, or private response dumps are included.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Instagram Edits SDK
|
|
2
|
+
|
|
3
|
+
Unofficial Python SDK and developer documentation for Instagram Edits analytics,
|
|
4
|
+
Reel insights, audience statistics, and retention curves. Python 3.10+, no runtime
|
|
5
|
+
dependencies. This is not an official Meta SDK or a hosted service.
|
|
6
|
+
|
|
7
|
+
## Install and use
|
|
8
|
+
|
|
9
|
+
The PyPI release is prepared for installation with:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
python -m pip install instagram-edits-sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Until the first upload completes, install from source:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
git clone https://github.com/lupikovoleg/instagram-edits-sdk.git
|
|
19
|
+
cd instagram-edits-sdk
|
|
20
|
+
python -m pip install .
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Distribution: `instagram-edits-sdk` 0.2.1. Import: `edits_api`. CLI: `edits-api`.
|
|
24
|
+
If migrating from the earlier local `instagram-edits-research` distribution,
|
|
25
|
+
uninstall it first: both distributions provide the same `edits_api` module.
|
|
26
|
+
Inject your own Instagram owner's session into `IG_SESSIONID` using a secret manager.
|
|
27
|
+
The library does not log in or read browser cookies.
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from edits_api import EditsClient
|
|
31
|
+
|
|
32
|
+
client = EditsClient.from_env()
|
|
33
|
+
reel = client.reel_insights("https://www.instagram.com/reel/YOUR_SHORTCODE/")
|
|
34
|
+
plays = reel.metrics.get("play_count")
|
|
35
|
+
retention = [{"index": p.index, "percent": p.percent} for p in reel.retention] \
|
|
36
|
+
if reel.retention_available else None
|
|
37
|
+
snapshot = reel.to_dict()
|
|
38
|
+
|
|
39
|
+
page = client.reels_page(first=3)
|
|
40
|
+
if page.has_next_page:
|
|
41
|
+
second_page = client.reels_page(first=3, after=page.next_cursor)
|
|
42
|
+
|
|
43
|
+
account = client.account_insights(include_time_series=True)
|
|
44
|
+
account_metrics = account.get_data("xig_user_by_igid_v2", "basel_insights")
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Missing/null/empty/all-null retention does not discard other Reel statistics.
|
|
48
|
+
`retention()` remains strict. Exports include JSON; CSV and SVG require available
|
|
49
|
+
retention. Null values are not replaced by zeros. Response aliases are resolved by
|
|
50
|
+
`QueryResult.get_data()`; the original payload remains available.
|
|
51
|
+
|
|
52
|
+
## Available methods and evidence
|
|
53
|
+
|
|
54
|
+
On 2026-10-18, the SDK made nine successful read-operation requests on one consenting
|
|
55
|
+
account and an additional pagination request. Seven operations returned data.
|
|
56
|
+
`comment_insights()` returned a null analysis block; `kits()` returned an empty list.
|
|
57
|
+
These two results do not verify populated feature responses. Account availability,
|
|
58
|
+
other enum combinations, batch limits, and future server compatibility are not guaranteed.
|
|
59
|
+
|
|
60
|
+
Methods: `reel_insights`, `retention`, `public_insights`, `reels_page`, `account_reels`,
|
|
61
|
+
`account_insights`, `audience_insights`, `reels_delta`, `comment_insights`, `kits`,
|
|
62
|
+
`extended_reel_insights`, and the explicit `execute` interface.
|
|
63
|
+
|
|
64
|
+
The source includes 15 detailed operation contracts, an 88-entry Basel/Eddy index,
|
|
65
|
+
and the full 1663-operation APK registry. Mutations are untested and require explicit
|
|
66
|
+
opt-in. No automatic retries, token refresh, challenge bypass, or unbounded pagination.
|
|
67
|
+
|
|
68
|
+
[Russian quickstart](README.md) Β· [Data reference and all-method examples](docs/data-reference.md)
|
|
69
|
+
Β· [Authentication](docs/authentication.md) Β· [HTTP](docs/http-api.md)
|
|
70
|
+
Β· [Swagger / OpenAPI](docs/swagger.md) Β· [Verification scope](docs/verification.md)
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
python -m unittest discover -s tests -v
|
|
74
|
+
python examples/offline_demo.py
|
|
75
|
+
python tools/check_release.py
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Tests use synthetic data without network access. Sanitized live evidence is separate.
|
|
79
|
+
No APK, decompiled Meta sources, credentials, or personal response dumps are shipped.
|
|
80
|
+
Original project code/docs: MIT. Bundled Swagger UI: Apache-2.0.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Instagram Edits SDK
|
|
2
|
+
|
|
3
|
+
ΠΠ΅ΠΎΡΠΈΡΠΈΠ°Π»ΡΠ½ΡΠΉ Python SDK ΠΈ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ Π²Π½ΡΡΡΠ΅Π½Π½ΠΈΡ
ΠΌΠ΅ΡΠΎΠ΄ΠΎΠ² Instagram Edits:
|
|
4
|
+
ΡΡΠ°ΡΠΈΡΡΠΈΠΊΠ° Reels, ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠ΅, Π°Π½Π°Π»ΠΈΡΠΈΠΊΠ° Π°ΠΊΠΊΠ°ΡΠ½ΡΠ° ΠΈ Π°ΡΠ΄ΠΈΡΠΎΡΠΈΠΈ. ΠΠ»Ρ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΠΈ Π² ΡΠ²ΠΎΠΉ
|
|
5
|
+
backend ΠΈΠ»ΠΈ Π°Π½Π°Π»ΠΈΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΡΠ΅ΡΠ²ΠΈΡ. Python 3.10+, Π±Π΅Π· Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ Π²ΠΎ Π²ΡΠ΅ΠΌΡ ΡΠ°Π±ΠΎΡΡ.
|
|
6
|
+
|
|
7
|
+
**ΠΡΠΎΠ²Π΅ΡΠ΅Π½ΠΎ 18 ΠΎΠΊΡΡΠ±ΡΡ 2026:** Π΄Π΅Π²ΡΡΡ ΠΌΠ΅ΡΠΎΠ΄ΠΎΠ² ΡΡΠ΅Π½ΠΈΡ ΡΠ΅ΡΠ΅Π· ΡΠ΅Π°Π»ΡΠ½ΡΠ΅ Π·Π°ΠΏΡΠΎΡΡ SDK
|
|
8
|
+
Π½Π° ΠΎΠ΄Π½ΠΎΠΌ Π°ΠΊΠΊΠ°ΡΠ½ΡΠ΅, ΠΏΠ»ΡΡ ΡΠ»Π΅Π΄ΡΡΡΠ°Ρ ΡΡΡΠ°Π½ΠΈΡΠ° Reels. Π‘Π΅ΠΌΡ ΠΌΠ΅ΡΠΎΠ΄ΠΎΠ² Π²Π΅ΡΠ½ΡΠ»ΠΈ Π΄Π°Π½Π½ΡΠ΅;
|
|
9
|
+
Π°Π½Π°Π»ΠΈΠ· ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠ΅Π² Π²Π΅ΡΠ½ΡΠ» `null`, Kits β ΠΏΡΡΡΠΎΠΉ ΡΠΏΠΈΡΠΎΠΊ. ΠΡΠΎ Π½Π΅ ΠΎΡΠΈΡΠΈΠ°Π»ΡΠ½ΡΠΉ SDK
|
|
10
|
+
Meta ΠΈ Π½Π΅ Π³Π°ΡΠ°Π½ΡΠΈΡ Π΄ΠΎΡΡΡΠΏΠ½ΠΎΡΡΠΈ Π΄Π°Π½Π½ΡΡ
Ρ Π»ΡΠ±ΠΎΠ³ΠΎ Π°ΠΊΠΊΠ°ΡΠ½ΡΠ°.
|
|
11
|
+
|
|
12
|
+
[English](README.en.md) Β· [ΠΠ°ΠΊΠΈΠ΅ Π΄Π°Π½Π½ΡΠ΅ Π΄ΠΎΡΡΡΠΏΠ½Ρ](docs/data-reference.md)
|
|
13
|
+
Β· [ΠΠ΅ΡΠΎΠ΄Ρ](docs/methods.md) Β· [ΠΠ²ΡΠΎΡΠΈΠ·Π°ΡΠΈΡ](docs/authentication.md)
|
|
14
|
+
Β· [ΠΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΡ](docs/integration.md) Β· [HTTP](docs/http-api.md)
|
|
15
|
+
Β· [Swagger / OpenAPI](docs/swagger.md) Β· [ΠΡΠΎΠ²Π΅ΡΠΊΠΈ](docs/verification.md) Β· [ΠΡΠΏΡΡΠΊ Π² PyPI](docs/releasing.md)
|
|
16
|
+
|
|
17
|
+
## Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ°
|
|
18
|
+
|
|
19
|
+
ΠΠ»Ρ ΡΠ΅Π»ΠΈΠ·Π° Π² PyPI ΠΏΠΎΠ΄Π³ΠΎΡΠΎΠ²Π»Π΅Π½Π° ΠΊΠΎΠΌΠ°Π½Π΄Π°:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
python -m pip install instagram-edits-sdk
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
ΠΠΎ Π·Π°Π²Π΅ΡΡΠ΅Π½ΠΈΡ ΠΏΠ΅ΡΠ²ΠΎΠΉ ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΠΈΠ· ΠΈΡΡ
ΠΎΠ΄Π½ΠΈΠΊΠΎΠ²:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
git clone https://github.com/lupikovoleg/instagram-edits-sdk.git
|
|
29
|
+
cd instagram-edits-sdk
|
|
30
|
+
python -m pip install .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
ΠΠΌΡ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π° β `instagram-edits-sdk`, ΠΈΠΌΠΏΠΎΡΡ β `edits_api`, ΠΊΠΎΠΌΠ°Π½Π΄Π° β
|
|
34
|
+
`edits-api`. ΠΠ΅ΡΡΠΈΡ 0.2.1. ΠΡΠΈ ΠΏΠ΅ΡΠ΅Ρ
ΠΎΠ΄Π΅ Ρ Π»ΠΎΠΊΠ°Π»ΡΠ½ΠΎΠ³ΠΎ `instagram-edits-research`
|
|
35
|
+
ΡΠ΄Π°Π»ΠΈΡΠ΅ ΡΡΠ°ΡΡΠΉ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²: ΠΎΠ±Π° ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡΡ ΠΎΠ΄ΠΈΠ½ Python-ΠΌΠΎΠ΄ΡΠ»Ρ `edits_api`.
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
python -m pip uninstall instagram-edits-research
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Π‘ΡΠ°ΡΠΈΡΡΠΈΠΊΠ° Reel, Π΄Π°ΠΆΠ΅ Π±Π΅Π· ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΡ
|
|
42
|
+
|
|
43
|
+
ΠΠ΅ΡΠ΅Π΄Π°ΠΉΡΠ΅ ΠΏΡΠΎΡΠ΅ΡΡΡ `IG_SESSIONID` ΠΈΠ· ΡΠ²ΠΎΠ΅Π³ΠΎ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ° ΡΠ΅ΠΊΡΠ΅ΡΠΎΠ². ΠΡΠΆΠ½Π° ΡΠ΅ΡΡΠΈΡ
|
|
44
|
+
Instagram Π²Π»Π°Π΄Π΅Π»ΡΡΠ° ΡΠΎΠ»ΠΈΠΊΠ°. ΠΠ°ΡΠΎΠ»Ρ ΠΈ ΡΠΎΠΊΠ΅Π½ ΠΏΡΠ±Π»ΠΈΡΠ½ΠΎΠ³ΠΎ Graph API Π΅Ρ Π½Π΅ Π·Π°ΠΌΠ΅Π½ΡΡΡ.
|
|
45
|
+
SDK Π½Π΅ ΠΈΠ·Π²Π»Π΅ΠΊΠ°Π΅Ρ cookie ΠΈΠ· Π±ΡΠ°ΡΠ·Π΅ΡΠ° ΠΈ Π½Π΅ Π²ΡΠΏΠΎΠ»Π½ΡΠ΅Ρ Π²Ρ
ΠΎΠ΄.
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from edits_api import EditsClient
|
|
49
|
+
|
|
50
|
+
client = EditsClient.from_env()
|
|
51
|
+
reel = client.reel_insights("https://www.instagram.com/reel/YOUR_SHORTCODE/")
|
|
52
|
+
|
|
53
|
+
print(reel.metrics.get("play_count"))
|
|
54
|
+
print(reel.metrics.get("like_count"))
|
|
55
|
+
print(reel.metrics.get("skip_rate")) # ΠΠ±ΡΠ΅ΠΊΡ Ρ value/delta ΠΈΠ»ΠΈ None.
|
|
56
|
+
|
|
57
|
+
if reel.retention_available:
|
|
58
|
+
points = [{"index": p.index, "percent": p.percent} for p in reel.retention]
|
|
59
|
+
else:
|
|
60
|
+
points = None # ΠΠ΅Ρ Π΄Π°Π½Π½ΡΡ
, Π° Π½Π΅ Π½ΡΠ»Π΅Π²ΠΎΠ΅ ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠ΅.
|
|
61
|
+
|
|
62
|
+
snapshot = reel.to_dict() # ΠΠΎΠΆΠ½ΠΎ ΡΠΎΡ
ΡΠ°Π½ΠΈΡΡ Π² ΡΠ²ΠΎΠ΅ΠΉ ΠΠ.
|
|
63
|
+
reel.export("results/my-reel") # ΠΠΎΠ²ΡΠΉ ΠΊΠ°ΡΠ°Π»ΠΎΠ³: JSON; CSV/SVG ΡΠΎΠ»ΡΠΊΠΎ Ρ ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠ΅ΠΌ.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
ΠΡΡΡΡΡΡΠ²ΡΡΡΠ΅Π΅, `null`, ΠΏΡΡΡΠΎΠ΅ ΠΈΠ»ΠΈ ΠΏΠΎΠ»Π½ΠΎΡΡΡΡ `null`-ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠ΅ Π½Π΅ ΠΌΠ΅ΡΠ°Π΅Ρ ΠΏΠΎΠ»ΡΡΠΈΡΡ
|
|
67
|
+
ΠΎΡΡΠ°Π»ΡΠ½ΡΠ΅ ΠΌΠ΅ΡΡΠΈΠΊΠΈ. ΠΠ΅ΠΊΠΎΡΡΠ΅ΠΊΡΠ½Π°Ρ ΡΡΡΡΠΊΡΡΡΠ° ΠΎΡΠ²Π΅ΡΠ°, ΠΎΡΠΊΠ°Π· ΡΠ΅ΡΠ²Π΅ΡΠ° ΠΈΠ»ΠΈ Π΄ΡΡΠ³ΠΎΠΉ Π²Π»Π°Π΄Π΅Π»Π΅Ρ
|
|
68
|
+
Π²ΡΠ·ΡΠ²Π°ΡΡ `EditsError`. `client.retention()` β ΡΡΡΠΎΠ³ΠΈΠΉ Π²Π°ΡΠΈΠ°Π½Ρ: Π±Π΅Π· Π³ΡΠ°ΡΠΈΠΊΠ° Π²ΡΠ΄Π°ΡΡ ΠΎΡΠΈΠ±ΠΊΡ.
|
|
69
|
+
[ΠΡΠΈΠΌΠ΅Ρ ΡΡΠ°ΡΠΈΡΡΠΈΠΊΠΈ](examples/reel_statistics.py), [ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ ΠΎΠ± ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠΈ](docs/retention.md).
|
|
70
|
+
|
|
71
|
+
## ΠΠ΅ΡΠΎΠ΄Ρ SDK
|
|
72
|
+
|
|
73
|
+
| ΠΠ΅ΡΠΎΠ΄ | ΠΠ°Π½Π½ΡΠ΅ | Π Π΅Π·ΡΠ»ΡΡΠ°Ρ ΠΆΠΈΠ²ΠΎΠΉ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| `reel_insights()` / `retention()` | ΠΠ΅ΡΡΠΈΠΊΠΈ Reel, ΠΊΡΠΈΠ²Π°Ρ ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΡ | ΠΠ°Π½Π½ΡΠ΅, 62 ΡΠΎΡΠΊΠΈ |
|
|
76
|
+
| `public_insights()` | Π‘ΡΡΡΡΠΈΠΊΠΈ ΠΈ ΠΊΠΎΡΡΡΠΈΡΠΈΠ΅Π½ΡΡ Reel | ΠΠ°Π½Π½ΡΠ΅; ΠΏΡΠΎΠ²Π΅ΡΠ΅Π½ ΡΠ²ΠΎΠΉ Reel |
|
|
77
|
+
| `reels_page()` / `account_reels()` | Π‘ΠΏΠΈΡΠΎΠΊ Reels, ΠΌΠ΅ΡΡΠΈΠΊΠΈ, cursor | ΠΠ²Π΅ ΡΡΡΠ°Π½ΠΈΡΡ ΠΏΠΎ 3 ΡΠΎΠ»ΠΈΠΊΠ° |
|
|
78
|
+
| `account_insights()` | ΠΠ³ΡΠ΅Π³Π°ΡΡ ΠΈ Π²ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΡΡΠ΄Ρ | ΠΠ°Π½Π½ΡΠ΅ Π·Π° `LAST_30_DAYS` |
|
|
79
|
+
| `audience_insights()` | ΠΠ΅ΠΌΠΎΠ³ΡΠ°ΡΠΈΡ, ΡΠΎΡΡ, Π°ΠΊΡΠΈΠ²Π½ΠΎΡΡΡ ΠΏΠΎΠ΄ΠΏΠΈΡΡΠΈΠΊΠΎΠ² | ΠΠ°Π½Π½ΡΠ΅ Π·Π° `LAST_30_DAYS` |
|
|
80
|
+
| `reels_delta()` | ΠΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΌΠ΅ΡΡΠΈΠΊ ΡΠΏΠΈΡΠΊΠ° ID | ΠΠ°Π½Π½ΡΠ΅ Π΄Π»Ρ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ID |
|
|
81
|
+
| `comment_insights()` | ΠΠ»ΠΎΠΊ AI-Π°Π½Π°Π»ΠΈΠ·Π° ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠ΅Π² | ΠΠ°ΠΏΡΠΎΡ ΠΏΡΠΈΠ½ΡΡ, Π±Π»ΠΎΠΊ `null` |
|
|
82
|
+
| `kits()` | ΠΠ°Π±ΠΎΡΡ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ² Edits | ΠΠ°ΠΏΡΠΎΡ ΠΏΡΠΈΠ½ΡΡ, ΡΠΏΠΈΡΠΎΠΊ ΠΏΡΡΡ |
|
|
83
|
+
| `extended_reel_insights()` | ΠΠ»ΡΡΠ΅ΡΠ½Π°ΡΠΈΠ²Π½Π°Ρ Π²Π΅ΡΠΊΠ° Instagram insights | ΠΡΠΈΠ²Π°Ρ ΡΠ΄Π΅ΡΠΆΠ°Π½ΠΈΡ ΠΈ Π΄Π΅ΠΌΠΎΠ³ΡΠ°ΡΠΈΡ |
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
page = client.reels_page(first=3)
|
|
87
|
+
for item in page.items:
|
|
88
|
+
print(item["id"], item.get("permalink"))
|
|
89
|
+
if page.has_next_page:
|
|
90
|
+
next_page = client.reels_page(first=3, after=page.next_cursor)
|
|
91
|
+
|
|
92
|
+
account = client.account_insights(include_time_series=True)
|
|
93
|
+
metrics = account.get_data("xig_user_by_igid_v2", "basel_insights")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`QueryResult.payload` Ρ
ΡΠ°Π½ΠΈΡ ΠΈΡΡ
ΠΎΠ΄Π½ΡΠΉ ΠΎΡΠ²Π΅Ρ. `get_data()` ΡΠ°Π·ΡΠ΅ΡΠ°Π΅Ρ ΡΠ°ΠΊΡΠΈΡΠ΅ΡΠΊΠΈΠ΅
|
|
97
|
+
canonical-ΠΈΠΌΠ΅Π½Π° (`1$xig_user_by_igid_v2(id:$user_id)` ΠΈ ΠΏΠΎΠ΄ΠΎΠ±Π½ΡΠ΅) ΠΏΠΎ Π»ΠΎΠ³ΠΈΡΠ΅ΡΠΊΠΈΠΌ
|
|
98
|
+
ΠΈΠΌΠ΅Π½Π°ΠΌ. ΠΠ½ Π½Π΅ Π½ΠΎΡΠΌΠ°Π»ΠΈΠ·ΡΠ΅Ρ Π΅Π΄ΠΈΠ½ΠΈΡΡ ΠΌΠ΅ΡΡΠΈΠΊ. [Π Π°Π±ΠΎΡΠ° ΡΠΎ Π²ΡΠ΅ΠΌΠΈ Π΄Π΅Π²ΡΡΡΡ ΠΌΠ΅ΡΠΎΠ΄Π°ΠΌΠΈ](docs/data-reference.md).
|
|
99
|
+
|
|
100
|
+
## ΠΠΎΠ½ΡΠΎΠ»Ρ ΠΈ ΠΏΡΠΈΠΌΠ΅ΡΡ
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
edits-api insights "https://www.instagram.com/reel/YOUR_SHORTCODE/" --output results/reel
|
|
104
|
+
edits-api retention "https://www.instagram.com/reel/YOUR_SHORTCODE/" --output results/curve
|
|
105
|
+
edits-api catalog
|
|
106
|
+
python examples/list_reels.py --first 3 --output results/page.json
|
|
107
|
+
python examples/account_statistics.py --period LAST_30_DAYS --output results/account.json
|
|
108
|
+
python examples/account_statistics.py --audience --output results/audience.json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
ΠΠ°ΡΠ°Π»ΠΎΠ³ΠΈ/ΡΠ°ΠΉΠ»Ρ Π²ΡΠ²ΠΎΠ΄Π° Π΄ΠΎΠ»ΠΆΠ½Ρ Π±ΡΡΡ Π½ΠΎΠ²ΡΠΌΠΈ. Π‘Π΅ΡΡΠΈΡ Π±Π΅ΡΡΡΡΡ ΠΈΠ· ΠΎΠΊΡΡΠΆΠ΅Π½ΠΈΡ, `--session
|
|
112
|
+
settings.json` Π»ΠΈΠ±ΠΎ `--session -` (JSON ΠΈΠ· stdin). Π‘Π΅ΠΊΡΠ΅ΡΡ Π½Π΅ ΠΏΠ΅ΡΠ΅Π΄Π°ΡΡΡΡ Π°ΡΠ³ΡΠΌΠ΅Π½ΡΠ°ΠΌΠΈ.
|
|
113
|
+
|
|
114
|
+
## ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ, ΠΏΡΠΎΠ²Π΅ΡΠΊΠ°, Π³ΡΠ°Π½ΠΈΡΡ
|
|
115
|
+
|
|
116
|
+
Π ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ 15 ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ ΡΠ°Π·ΠΎΠ±ΡΠ°Π½Π½ΡΡ
ΠΊΠΎΠ½ΡΡΠ°ΠΊΡΠΎΠ², ΠΈΠ½Π΄Π΅ΠΊΡ 88 ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΉ Ρ ΠΈΠΌΠ΅Π½Π°ΠΌΠΈ
|
|
117
|
+
Basel/Eddy ΠΈ ΠΎΠ±ΡΠΈΠΉ ΡΠ΅Π΅ΡΡΡ 1663 ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΉ APK 448.0.0.53.84. ΠΠ°Π»ΠΈΡΠΈΠ΅ Π·Π°ΠΏΠΈΡΠΈ Π² APK
|
|
118
|
+
ΡΠ°ΠΌΠΎ ΠΏΠΎ ΡΠ΅Π±Π΅ Π½Π΅ Π΄ΠΎΠΊΠ°Π·ΡΠ²Π°Π΅Ρ ΡΠ°Π±ΠΎΡΠΎΡΠΏΠΎΡΠΎΠ±Π½ΠΎΡΡΡ. Π£ ΠΊΠ°ΠΆΠ΄ΠΎΠΉ Π·Π°ΠΏΠΈΡΠΈ ΡΠ²ΠΎΠΉ ΡΡΠΎΠ²Π΅Π½Ρ Π΄ΠΎΠΊΠ°Π·Π°ΡΠ΅Π»ΡΡΡΠ².
|
|
119
|
+
|
|
120
|
+
Swagger ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ ΡΠ΅Π°Π»ΡΠ½ΡΠΉ `POST /graphql_www` ΠΈ Π΄Π΅Π²ΡΡΡ ΠΏΡΠΈΠΌΠ΅ΡΠΎΠ² ΡΠΎΡΠΌΡ Π·Π°ΠΏΡΠΎΡΠ°,
|
|
121
|
+
Π° Π½Π΅ Π²ΡΠ΄ΡΠΌΠ°Π½Π½ΡΠ΅ REST-endpoints. ΠΡΠΎΡΠΌΠΎΡΡ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Π»ΠΎΠΊΠ°Π»ΡΠ½ΠΎ Π±Π΅Π· CDN; ΠΎΡΠΏΡΠ°Π²ΠΊΠ° Π·Π°ΠΏΡΠΎΡΠΎΠ²
|
|
122
|
+
Π² UI ΠΎΡΠΊΠ»ΡΡΠ΅Π½Π°. [ΠΠ°ΠΊ ΠΎΡΠΊΡΡΡΡ](docs/swagger.md).
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
python -m unittest discover -s tests -v
|
|
126
|
+
python examples/offline_demo.py
|
|
127
|
+
python tools/generate_docs.py --check
|
|
128
|
+
python tools/check_release.py
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Π’Π΅ΡΡΡ ΡΠΈΠ½ΡΠ΅ΡΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΠΈ Π½Π΅ ΠΎΠ±ΡΠ°ΡΠ°ΡΡΡΡ ΠΊ Instagram. [ΠΠ±Π΅Π·Π»ΠΈΡΠ΅Π½Π½ΡΠ΅ ΡΠ²ΠΈΠ΄Π΅ΡΠ΅Π»ΡΡΡΠ²Π° ΠΆΠΈΠ²ΡΡ
|
|
132
|
+
Π·Π°ΠΏΡΠΎΡΠΎΠ²](docs/evidence/method-verification.json) ΠΎΡΠ΄Π΅Π»ΡΠ½ΠΎ ΡΠΈΠΊΡΠΈΡΡΡΡ ΡΠ΅Π°Π»ΡΠ½ΡΡ ΠΏΡΠΎΠ²Π΅ΡΠΊΡ.
|
|
133
|
+
|
|
134
|
+
ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΡ
retries, Π²Ρ
ΠΎΠ΄Π°, ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ ΡΠ΅ΡΡΠΈΠΈ ΠΈ ΠΎΠ±Ρ
ΠΎΠ΄Π° challenge Π½Π΅Ρ. ΠΡΠ΅Π΄Π΅Π»Ρ
|
|
135
|
+
Π·Π°ΠΏΡΠΎΡΠΎΠ² ΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² Π½Π΅ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Ρ. Mutations ΡΡΠ΅Π±ΡΡΡ `allow_mutation=True`, Π½Π΅
|
|
136
|
+
Π²Ρ
ΠΎΠ΄ΡΡ Π² ΠΏΡΠΎΠ²Π΅ΡΠ΅Π½Π½ΡΡ ΡΠ°ΡΡΡ SDK ΠΈ Π² ΠΈΡΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ΠΈΠΈ Π½Π° ΡΠ΅ΡΠ²Π΅ΡΠ΅ Π½Π΅ Π·Π°ΠΏΡΡΠΊΠ°Π»ΠΈΡΡ.
|
|
137
|
+
|
|
138
|
+
Π ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ Π½Π΅Ρ APK, ΠΈΡΡ
ΠΎΠ΄Π½ΠΈΠΊΠΎΠ² Meta, cookies, Π»ΠΈΡΠ½ΠΎΠΉ Π°Π½Π°Π»ΠΈΡΠΈΠΊΠΈ ΠΈ ΠΌΠ΅Π΄ΠΈΠ°.
|
|
139
|
+
MIT ΠΎΡΠ½ΠΎΡΠΈΡΡΡ ΠΊ ΠΎΡΠΈΠ³ΠΈΠ½Π°Π»ΡΠ½ΠΎΠΌΡ ΠΊΠΎΠ΄Ρ ΠΈ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ°; Swagger UI ΠΈΠΌΠ΅Π΅Ρ ΡΠ²ΠΎΡ
|
|
140
|
+
[Π»ΠΈΡΠ΅Π½Π·ΠΈΡ Apache-2.0](docs/swagger/vendor/LICENSE).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# GitHub repository metadata
|
|
2
|
+
|
|
3
|
+
**Repository name:** `instagram-edits-sdk`
|
|
4
|
+
|
|
5
|
+
**Description:**
|
|
6
|
+
|
|
7
|
+
> Unofficial Python SDK for Instagram Edits: Reel insights, retention curves, audience analytics, and reverse-engineered API documentation.
|
|
8
|
+
|
|
9
|
+
**Topics:**
|
|
10
|
+
|
|
11
|
+
`instagram` `instagram-edits` `python` `sdk` `reels` `analytics` `retention` `reverse-engineering` `openapi`
|
|
12
|
+
|
|
13
|
+
**Suggested About website:** leave blank until documentation is hosted.
|
|
14
|
+
|
|
15
|
+
**Initial release title:** `v0.2.1 β Reel analytics SDK and verified read methods`
|
|
16
|
+
|
|
17
|
+
**Release summary:**
|
|
18
|
+
|
|
19
|
+
> Installable Python SDK with Reel statistics that remain available when retention is missing, cursor-based pagination, account and audience analytics, examples, and local Swagger documentation. Nine read operations were exercised on one consenting account; comment analysis returned null and Kits returned an empty list. No mutations were tested. Not affiliated with Meta.
|
|
20
|
+
|
|
21
|
+
The repository, package distribution, and Python import have different names:
|
|
22
|
+
|
|
23
|
+
| Purpose | Name |
|
|
24
|
+
|---|---|
|
|
25
|
+
| GitHub repository | `instagram-edits-sdk` |
|
|
26
|
+
| Python distribution | `instagram-edits-sdk` |
|
|
27
|
+
| Python import | `edits_api` |
|
|
28
|
+
| CLI | `edits-api` |
|
|
29
|
+
|
|
30
|
+
The GitHub repository contains the SDK source, examples and documentation. Installation instructions are in README.md. The first PyPI release is being prepared. No hosted API is provided.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Credentials and private data
|
|
2
|
+
|
|
3
|
+
Report credential exposure privately to the repository maintainer; do not paste
|
|
4
|
+
tokens into an issue. This repository does not operate an authentication service.
|
|
5
|
+
|
|
6
|
+
Session credentials belong in your secret manager or a local ignored file.
|
|
7
|
+
Exports can contain personal analytics and signed media URLs. Do not commit them.
|
|
8
|
+
If a credential was exposed, end the relevant Instagram session using Instagram's
|
|
9
|
+
account controls and replace the credential in your service.
|
|
10
|
+
|
|
11
|
+
The client verifies TLS, does not follow redirects with credentials, bounds
|
|
12
|
+
response sizes and timeouts, and does not log request headers. It does not bypass
|
|
13
|
+
Instagram account challenges or implement arbitrary-target HTTP requests.
|