API Calls

Discover endpoints and make single API requests with flexible output formats and field filtering

Discover Endpoints

Before calling an endpoint, use anysite describe to see what is available. It reads from the local schema cache — run anysite schema update first (Installation).

# List all endpoints
anysite describe

# Search by keyword
anysite describe --search "company"

# Inspect one endpoint: input parameters and output fields
anysite describe /api/linkedin/company

# Machine-readable, with examples and defaults
anysite describe /api/linkedin/company --json

The full, current endpoint catalog is also browsable at /docs/api.

Basic Syntax

anysite api <endpoint> [key=value ...] [OPTIONS]

Parameters are passed as key=value pairs. The CLI converts types based on the cached schema.

Examples

anysite api /api/linkedin/user user=satyanadella
anysite api /api/linkedin/company company=anthropic
anysite api /api/linkedin/search/users keywords="CTO" count=50
anysite api /api/instagram/user user=natgeo
anysite api /api/twitter/user user=elonmusk

Output Formats

Control how results are displayed with --format (or -f): json (default), jsonl, csv, or table. Saving to a file also accepts parquet (requires --output).

JSON (default)

```bash
anysite api /api/linkedin/user user=satyanadella --format json
```

CSV

```bash
anysite api /api/linkedin/search/users keywords="CTO" count=10 --format csv
```

JSONL

```bash
anysite api /api/linkedin/company/employees companies=anthropic --format jsonl
```
One JSON object per line — ideal for streaming and piping to other tools.

Table

```bash
anysite api /api/linkedin/user user=satyanadella --format table
```
Rich table for terminal viewing.

anysite api prints the API result directly in the chosen format — it does not wrap output in the {ok, result, hints, meta} JSON envelope used by other subcommands. See Agent Protocol for the distinction.

Field Filtering

Include or Exclude Fields

# Include only these fields (dot-notation supported)
anysite api /api/linkedin/user user=satyanadella --fields "name,headline,urn.value"

# Exclude fields
anysite api /api/linkedin/user user=satyanadella --exclude "certifications,courses,honors"

Field Presets

anysite api /api/linkedin/user user=satyanadella --fields-preset minimal
anysite api /api/linkedin/user user=satyanadella --fields-preset contact
anysite api /api/linkedin/user user=satyanadella --fields-preset recruiting

Saving Output

# Save to file
anysite api /api/linkedin/search/users keywords="CTO" count=50 \
  --format csv --output ctos.csv

# Compact JSON (no indentation)
anysite api /api/linkedin/user user=satyanadella --compact

# Quiet mode — suppress progress messages, for clean piping
anysite api /api/linkedin/user user=satyanadella -q --format jsonl

Piping to Other Tools

# API → Database
anysite api /api/linkedin/user user=satyanadella -q --format jsonl | \
  anysite db insert mydb --table profiles --stdin --auto-create

# API → File
anysite api /api/linkedin/search/users keywords="engineer" count=100 \
  -q --format csv > engineers.csv

# API → jq filtering
anysite api /api/linkedin/user user=satyanadella -q | jq '.name, .headline'

Options Reference

Option Short Description
--format -f Output format: json, jsonl, csv, table, parquet (default: json)
--fields Include only specified fields (comma-separated, dot-notation)
--exclude Exclude specified fields from output
--fields-preset Built-in field preset: minimal, contact, recruiting
--compact Minify JSON output
--output -o Save output to file
--quiet -q Suppress non-data output

Next Steps

Batch Processing

Process multiple inputs with parallelism and rate limiting

Dataset Pipelines

Build multi-source workflows with dependency chains