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.2

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.2
File Size Uploaded Provenance Actions
hiinsta-0.7.2.tar.gz 16.4 kB With provenance Details for hiinsta-0.7.2.tar.gz

Built distribution (wheel)

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

Total release size: 34.9 kB

Release files / hiinsta-0.7.2.tar.gz

Download URL hiinsta-0.7.2.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
53c1e1a018f82039d562703a9b58cc4f8fde6dbcc086db1981c2693df7e3ca4d
BLAKE2b-256 checksum
How to use checksums
240eb461b267eeee17ed162cef7799517e9456ee662ed6dc67fa80731cacddcc
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 4, 2026.

Transparency log

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

Download URL hiinsta-0.7.2-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
022b760f5f9886c87da66f57682fcad38fd54ac79f8b0c0c8ba8ef41e5a25e0c
BLAKE2b-256 checksum
How to use checksums
65af90af2a57b779461e61aa2f8db3dd23b6f25f9a74d9cfb041f2a9e6415f2d
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 4, 2026.

Transparency log

Security for hiinsta 0.7.2

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.2.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 4, 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