Skip to main content

CLI for Anakin.io web scraping, search, and research API

Project description

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

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

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

anakin_cli-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

anakin_cli-0.1.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file anakin_cli-0.1.1.tar.gz.

File metadata

  • Download URL: anakin_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for anakin_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 adb43286a49ff9d19023cc7001ffdeba4ec14b92c3ff8dbfd2dabacb5c5a7271
MD5 3f72c327f6208be375175e12d3b9eb5c
BLAKE2b-256 3cc6f2019e3907e3a073680e026826e83a2aea339c5f66da9b445e7577a67103

See more details on using hashes here.

File details

Details for the file anakin_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: anakin_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for anakin_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d5b563be7a52c1db54905eabedc9a92596d2715f16e56b0e410865d4b5b6bb4
MD5 96fb8d72d450b1650a5e7453c23d5389
BLAKE2b-256 1bc70b0fb7e5b95596cadeba1ed95b34264e51de55421eb2637b5d1a7ea8955e

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