Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Έ Qinstagram

Enterprise Private API Architecture & Real-Time Engagement Kit

High-performance Rust toolkit for advanced Instagram Direct messaging, automated feeds, and real-time storytelling

crates.io docs.rs CI License

Tokio Reqwest GraphQL WebSocket MQTT Linux

⚠️ Compliance Warning: This toolkit interfaces directly with Meta's Private API surface. It is engineered strictly for educational research, security emulation, and authorized AI infrastructure design. Violation of the primary Instagram Terms Of Service (e.g. unsolicited spam, fake account orchestration) via this library may result in severe account penalties or legal Cease & Desist orders. You assume all operational liabilities.


πŸš€ Quick Start

cargo add qinstagram

Or add to your Cargo.toml:

[dependencies]
qinstagram = "0.1"
tokio = { version = "1", features = ["full"] }
use qinstagram::client::InstagramClient;
use qinstagram::config::LoginConfig;

#[tokio::main]
async fn main() {
    let mut client = InstagramClient::builder()
        .credentials("username", "password")
        .build()
        .unwrap();

    // Authenticate and establish secure session (supports 2FA & Checkpoints)
    client.login().await.unwrap();

    // Directly access messaging infrastructure
    let threads = client.get_threads(None).await.unwrap();
    println!("Fetched {} direct threads", threads.threads.len());
}

Selective features: cargo add qinstagram --no-default-features --features realtime,media


✨ Features

  • 4 distinct workflow modules cleanly organized reflecting Instagram's domain architecture.
  • Enterprise GraphQL Parity β€” Drops cleanly into external architectural ecosystems like Qicro matching 100% of endpoints via Schema definition logic.
  • WebSocket Push Capabilities β€” Bridge MQTT direct into React/Svelte5 frontends via Tokio sync broadcasts.
  • Panic-free Library β€” robust error handling wrapping and propagating InstagramError instances.
  • Two-Factor and Challenge Flows β€” seamlessly navigate verification checkpoint gates.
  • MQTT Event Capabilities β€” unified fallback messaging and real-time syncing.
  • Ruploado Media Configuration β€” highly complex custom media routing built manually into Rust.

πŸ“¦ Module Overview

πŸ” Authentication & Session

Module Description Docs
auth Stateful Password login, 2FA challenge responses, Session lifecycle & persistent multi-user credentials πŸ“–
transport Payload signing, deterministic device ID generation, request header synthesis, and Android emulation πŸ“–

πŸ’¬ Direct Communication

Module Description Docs
unified_direct Direct message fetching, fuzzy inbox search, message parser engine, un-sending πŸ“–
media_upload Two-step direct media configuration and rupload data injection πŸ“–
broadcast Liking, reacting, responding with URL parsing and state tracking πŸ“–

🎞️ Experiences

Module Description Docs
stories Story and reels gathering, tray parsing, real-time media seen tracking capabilities πŸ“–
feed News inbox analysis, timeline extraction and pagination πŸ“–
realtime MQTT Skywalker integration behind --features realtime πŸ“–

πŸ”Œ Ecosystem Integrations

Module Description Docs
graphql 100% declarative schema mapping (Qicro Standard) securely mapping query/mutation contexts on auth environments πŸ“–
ws Native axum drop-in logic exposing underlying MQTT binaries to high-speed JSON web sockets via tokio-broadcaster πŸ“–

πŸ“š Full documentation index: docs/readme.md


πŸš€ Usage

Session Injection & Media Tracking

use qinstagram::client::InstagramClient;

#[tokio::main]
async fn main() {
    let client = InstagramClient::from_session("username").await.unwrap();

    // Exfiltrate media targeting
    let media_candidates = client.get_reels_tray().await.unwrap();
    
    // Broadcast Seen State back to network
    client.mark_stories_as_seen(&media_candidates[0].stories).await.unwrap();
    
    // Send Reactions
    let target_thread = client.search_thread_by_username("friend_account").await.unwrap();
    client.send_reaction(&target_thread.unwrap().thread_id, "12345_67", "πŸ”₯").await.unwrap();
}

βš™οΈ Feature Flags

Include only what you need:

[dependencies]
qinstagram = { version = "0.1.0", features = ["realtime", "graphql", "websocket"] }
All feature flags
# Subsystem Engines
realtime = []
media = []

# Architectural Frameworks
graphql = ["async-graphql"]
websocket = ["axum", "futures-util"]

# Development Mocks
tests-mock = []

πŸ—οΈ Build

# Core framework
cargo build

# All experimental modules
cargo build --all-features

# Release compilation
cargo build --all-features --release

# Run rigorous unit tests and offline mock parsers
cargo test --all-features

πŸ“ Project Structure

Qinstagram/
β”œβ”€β”€ Cargo.toml                        # Dependencies & architectural flags
β”œβ”€β”€ README.md                         # This file
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib.rs                        # API facade and Module exports
β”‚   β”‚
β”‚   │── auth/                         # Sessions, Challenges & Verification
β”‚   │── direct/                       # Thread logic, Search, Broadcast, Parser
β”‚   │── feed/                         # Core API Timelines
β”‚   │── media/                        # Downloads & Complex Upload Protocols
β”‚   │── realtime/                     # Under heavy development MQTT
β”‚   │── stories/                      # Trays & state persistence
β”‚   │── transport/                    # Emulation context and networking
β”‚   └── types/                        # Struct parity wrappers
β”‚
β”œβ”€β”€ docs/                             # Component Reference Documentation 
β”‚   β”œβ”€β”€ readme.md                     # Documentation index
β”‚   └── [module_name].md
β”‚
β”œβ”€β”€ examples/                         # Real-world usage scenarios
└── tests/                            # Offline JSON structural integrity testing

πŸ“Š Stats

Metric Value
Total modules 9
Extracted Data Types ~60
Real-time MQTT endpoints 2
HTTP Message Builders 14
Supported Media Upload Photo + Video + Link

πŸ‘€ Author

Keyvan Arasteh
Keyvan Arasteh
@keyvanarasteh

Built with πŸ¦€ Rust β€” Δ°stinye University

About

No description, website, or topics provided.

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages