Skip to main content

Anakin CLI

PyPI version Python License: MIT

Command-line interface for Anakin.io's web scraping, search, and research API.

Requirements

Install

pip install anakin-cli

Quick Start

# Authenticate
anakin login --api-key "ak-your-key-here"

# Verify
anakin status

# Search the web
anakin search "python async best practices"

# Scrape a page to markdown
anakin scrape "https://example.com" -o page.md

# Extract structured data (AI-powered)
anakin scrape "https://example.com/product" --format json -o product.json

# Batch scrape multiple URLs
anakin scrape-batch "https://a.com" "https://b.com" -o batch.json

# Deep research (1-5 minutes)
anakin research "comparison of web frameworks 2025" -o report.json

Self-Hosted Mode

Use anakin-cli with a self-hosted AnakinScraper OSS instance:

# Start the OSS server
git clone https://github.com/AnakinAI/anakinscraper-oss.git && cd anakinscraper-oss && make up

# Scrape via your local instance (no API key needed)
anakin scrape "https://example.com" --api-url http://localhost:8080

# Or set it as your default
export ANAKIN_API_URL="http://localhost:8080"
anakin scrape "https://example.com"

Self-hosted mode supports scrape and scrape-batch. For search and research, use the hosted API with an API key.

Commands

Command Description
search AI-powered web search (instant)
scrape Scrape a single URL — markdown, JSON, or raw
scrape-batch Scrape up to 10 URLs at once
research Deep agentic research (1-5 min)
login Save your API key
status Check version and auth status

Scrape Formats

The scrape command supports three output formats via --format:

# Default — clean page text
anakin scrape "https://example.com"

# AI-extracted structured data
anakin scrape "https://example.com/product" --format json -o data.json

# Full API response (for debugging)
anakin scrape "https://example.com" --format raw -o debug.json
Format What you get Size
markdown (default) Clean readable page text Small
json AI-extracted structured data only Small
raw Full API response (html, metadata, everything) Large

Other scrape options

--browser          # Use headless browser (for JS-heavy sites)
--country CC       # Country code (default: us)
--session-id ID    # Session ID for authenticated scraping
--timeout SECS     # Polling timeout in seconds (default: 120)
-o, --output FILE  # Save output to file

Authentication

Get your API key at anakin.io/dashboard.

Option A — Login command (recommended):

anakin login --api-key "ak-your-key-here"

Option B — Environment variable:

export ANAKIN_API_KEY="ak-your-key-here"

If no key is configured, the CLI will prompt you to enter one interactively.

Error Handling

The CLI provides clear error messages for common issues:

Error Cause Fix
Authentication failed (401) Invalid or missing API key Run anakin login --api-key "ak-xxx"
Plan upgrade required (402) Feature not available on your plan Visit anakin.io/pricing
Rate limit exceeded (429) Too many requests Wait a few seconds and retry
Job did not complete within Xs Scrape/research timed out Increase with --timeout 300
Job failed Server could not process the URL Check if the URL is accessible

All errors exit with code 1. Success exits with code 0.

Tips

  • Always quote URLs that contain ?, &, or # — shells like zsh interpret these as special characters:
    # Wrong — zsh will fail with "no matches found"
    anakin scrape https://example.com/page?id=123
    
    # Correct
    anakin scrape "https://example.com/page?id=123"
    
  • Use --browser for JavaScript-heavy sites (SPAs, dynamic content).
  • Use -o to save output to a file. Without it, output goes to stdout.
  • All progress/status messages go to stderr, so piping works cleanly:
    anakin scrape "https://example.com" | jq '.title'
    

Documentation

Support

License

MIT

Metadata

Release files for anakin-cli 0.2.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 anakin-cli 0.2.0
File Size Uploaded Provenance Actions
anakin_cli-0.2.0.tar.gz 9.7 kB Without provenance Details for anakin_cli-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anakin-cli 0.2.0
File Interpreter ABI Platform Actions
anakin_cli-0.2.0-py3-none-any.whl Python 3 none any Details for anakin_cli-0.2.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / anakin_cli-0.2.0.tar.gz

Download URL anakin_cli-0.2.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
67709a79d5930757779da0d5dc91c9ca0ab70666a9952ddaf3dbdd0f5035b6e3
BLAKE2b-256 checksum
How to use checksums
37c346253bb48484d952da184398b0af45676f373516f253019890d52d6c2e2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / anakin_cli-0.2.0-py3-none-any.whl

Download URL anakin_cli-0.2.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b0ea8d3aafcb0afa261f523a89aacaa8f8bdb0a230342d2d45c036253e1915f
BLAKE2b-256 checksum
How to use checksums
4893a36ed41662e4b759273b1f33ea3e92a539ee5000cc869cb0c7967b02be46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for anakin-cli 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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