Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Mindcase Python SDK

Official Python SDK for the Mindcase Developer API — programmatic access to 30+ data collection agents across Instagram, LinkedIn, YouTube, Amazon, Google Maps, and more.

Installation

pip install mindcase

Quick Start

from mindcase import Mindcase

client = Mindcase(api_key="mk_live_...")
# Or set MINDCASE_API_KEY env var and omit api_key

# Run an agent and get results
results = client.run("instagram/profiles", params={
    "usernames": ["nike", "adidas"]
})

for row in results:
    print(f"{row['Username']}: {row['Followers']} followers")

API Reference

Discovery

# List all agents
agents = client.agents.list()

# Filter by platform
agents = client.agents.list("instagram")

# Get agent details + required params
agent = client.agents.get("instagram/profiles")
print(agent.required_params)

Run Agents

# Sync — blocks until results
results = client.run("instagram/profiles", params={
    "usernames": ["nike"]
})

# Async — returns immediately
job = client.run_async("instagram/profiles", params={
    "usernames": ["nike"]
})
print(job.id, job.status)

Manage Jobs

jobs = client.jobs.list()
job = client.jobs.get("job_abc123")
results = client.jobs.results("job_abc123")
client.jobs.cancel("job_abc123")

Credits

balance = client.credits()

Error Handling

from mindcase import (
    Mindcase,
    AuthenticationError,
    InsufficientCreditsError,
    RateLimitError,
    ValidationError,
    NotFoundError,
)

try:
    results = client.run("instagram/profiles", params={
        "usernames": ["nike"]
    })
except AuthenticationError:
    print("Invalid API key")
except InsufficientCreditsError:
    print("Not enough credits")
except RateLimitError:
    print("Too many requests")

Configuration

client = Mindcase(
    api_key="mk_live_...",                          # or MINDCASE_API_KEY env var
    base_url="https://api.mindcase.co/api/v1",     # default
    timeout=30,                                      # HTTP timeout (seconds)
    poll_interval=3.0,                               # polling interval (seconds)
    run_timeout=300,                                  # max wait for run() (seconds)
)

Documentation

Full docs: docs.mindcase.co

Metadata

Release files for mindcase 0.3.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 mindcase 0.3.0
File Size Uploaded
mindcase-0.3.0.tar.gz 6.4 kB Details

Built distribution (wheel)

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

Total release size: 14.9 kB

Release files / mindcase-0.3.0.tar.gz

Download URL mindcase-0.3.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
aee1b61b95c6f8fbf78f6b0b7ac60e958b60204df0937f316862aa8bfa0fff97
BLAKE2b-256 checksum
How to use checksums
0a77235308a21cf33fa240a14f768f5159d084593f7013f66035fb97adfdc5b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / mindcase-0.3.0-py3-none-any.whl

Download URL mindcase-0.3.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68eeb8f000440cd88279595dea7ce5d3ce11687da6cbb02ec4a9e96ca176839e
BLAKE2b-256 checksum
How to use checksums
20a9859c26a22b4eca4f3b9651d2bb4ba90a0db45f79a3f9d2f39f38afcf9abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

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