Skip to main content

Python client for https://boxapi.ir to crawl and read Instagram data.

Project description

BoxAPI Python

A Python client for interacting with the Box API for Instagram. This library wraps multiple Instagram endpoints including user information, media retrieval, and direct messages, allowing you to easily integrate Instagram functionality into your Python applications.

Note
I have not been able to test the DM API, so please make sure you test what you're doing before using it in production. If you find any errors, please open an issue or a pull request.

Table of Contents

Features

  • Modular Design: Separate sub-clients for general Instagram endpoints and direct message (DM) endpoints.
  • Easy Integration: Instantiate a single client to access the full functionality of the Box API.
  • Flexible Usage: Use DM endpoints only when needed—save overhead if your application doesn’t require them.
  • Extensible: Add additional endpoints or support for other platforms with minimal changes.

Installation

You can install the package via pip or Poetry.

Using pip

pip install boxapi

Using Poetry

poetry add boxapi

Usage

General Instagram API

from boxapi import BoxApiClient

# Initialize BoxApiClient with Box API credentials
# IMPORTANT: MAKE SURE YOU ARE READING YOUR USERNAME AND PASSWORD FROM ENVIRONMENT VARIABLES
box_client = BoxApiClient("your_boxapi_username", "your_boxapi_password")

# Use the Instagram sub-client for general endpoints
user_info = box_client.instagram.get_user_info("leomessi")

print(user_info)

Direct Messages

Direct Message functionality is available through a separate sub-client. Instantiate it when needed:

from boxapi import BoxApiClient

# Initialize BoxApiClient with Box API credentials
box_client = BoxApiClient("your_boxapi_username", "your_boxapi_password")

# Use DM endpoints by providing the Instagram account credentials per call
login_response = box_client.instagram_dm.direct_login("insta_username", "insta_password")
print(login_response)

Examples

Check out the examples folder for complete scripts demonstrating how to use the different features of this library (It's a work in progress).

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boxapi-1.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boxapi-1.0.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file boxapi-1.0.1.tar.gz.

File metadata

  • Download URL: boxapi-1.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.12.7-arch1-1.1-g14

File hashes

Hashes for boxapi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35ed2f09a87d6739d8856fdbac171cfc079dee9ad6116f998d859a53d079577d
MD5 b7503c16d706917c02a2b97901b538c0
BLAKE2b-256 1c9d431813b9f6c5cdbc87c5f80fa2aaa09c00e6c71d1954fff673c9291fcd66

See more details on using hashes here.

File details

Details for the file boxapi-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: boxapi-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.12.7-arch1-1.1-g14

File hashes

Hashes for boxapi-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b6a3a01952c3bd352871d1584de7c372710fde611a608184dd161845f3ffb3
MD5 23053f100082f5ff0dd5a5b630d0aaff
BLAKE2b-256 6b364f2485a890a6d497779fee9fcadfbc8e6cd651959cd50315c492ab564441

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page