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

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.0
File Size Uploaded Provenance Actions
hiinsta-0.7.0.tar.gz 15.5 kB With provenance Details for hiinsta-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 33.4 kB

Release files / hiinsta-0.7.0.tar.gz

Download URL hiinsta-0.7.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a891b8d55d966aa88c33cc2235c9ffd1c7846179a17e93f0f6d7800113543f23
BLAKE2b-256 checksum
How to use checksums
8b95eef7f16768229a4ea83f0ee627d96724265a98c733d1ccb22253b5330d29
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 7, 2026.

Transparency log

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

Download URL hiinsta-0.7.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4f326d153a955ac62306a420ff008d4606e184182fe9c8d2882ea5d3854d1aa
BLAKE2b-256 checksum
How to use checksums
6ef9dc0b811d86447507416b681c6233c99ef6a8c31cbd6e52af2402a24d44b5
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 7, 2026.

Transparency log

Security for hiinsta 0.7.0

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.0.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 7, 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