Skip to main content

hiinsta

A Python package for interacting with Instagram's messaging API.

Installation

pip install hiinsta

Usage

from hiinsta import InstagramMessenger

messenger = InstagramMessenger(access_token="YOUR_ACCESS_TOKEN")

# Example usage
message_id = await messenger.send_text("Hello, World!", recipient_id="RECIPIENT_ID")

print(message_id)

Webhook verification

Verify Meta's signature against the raw request body before parsing JSON:

from hiinsta import verify_signature

raw_body = request.get_data()
if not verify_signature(
    app_secret="YOUR_APP_SECRET",
    raw_body=raw_body,
    header=request.headers.get("X-Hub-Signature-256", ""),
):
    abort(403)

payload = request.get_json()

Do not hash json.dumps(request.get_json()); parsing and re-serializing can change whitespace or key ordering and will invalidate Meta's signature.

For Meta's webhook subscription handshake:

from hiinsta import verify_subscription

challenge = verify_subscription(request.args, verify_token="YOUR_VERIFY_TOKEN")
if challenge is None:
    abort(403)
return challenge

Development

To install in development mode:

git clone https://github.com/cervant-ai/hiinsta.git
cd hiinsta
pip install -e .

To install development dependencies:

pip install -e ".[dev]"

Testing

pytest
pip install -e ".[dev]"

Testing

pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for hiinsta 0.7.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 hiinsta 0.7.1
File Size Uploaded Provenance Actions
hiinsta-0.7.1.tar.gz 15.7 kB With provenance Details for hiinsta-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hiinsta 0.7.1
File Interpreter ABI Platform Actions
hiinsta-0.7.1-py3-none-any.whl Python 3 none any Details for hiinsta-0.7.1-py3-none-any.whl

Total release size: 33.6 kB

Release files / hiinsta-0.7.1.tar.gz

Download URL hiinsta-0.7.1.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e699326b7688357f0fc147779b89ff1c546e8811463f345d72c72fcd5e317c26
BLAKE2b-256 checksum
How to use checksums
8b772a3c24b64db84ae41f757371101c80badf300923ed4952fb1ba351fdd567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 9, 2026.

Transparency log

Release files / hiinsta-0.7.1-py3-none-any.whl

Download URL hiinsta-0.7.1-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd849de8a32cf696016952352e0a6f560c558faabd497c698283da6a58b483cd
BLAKE2b-256 checksum
How to use checksums
8430fc1f2a0cd1ff3616c0824fa90efa804c4adbde9e135e7c5b6a8975563f54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 9, 2026.

Transparency log

Security for hiinsta 0.7.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 hiinsta-0.7.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 Aug 9, 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