SDKs, CLI & MCP
Install and first-request snippets for the official Node, Python, Go, CLI, and MCP integrations. Each wraps auth, retries, rate limits, and typed responses.
SDKs, CLI & MCP
We publish official SDKs for the languages most customers use, plus a CLI and an MCP server. Each wraps the HTTP API with typed helpers, built-in retry/backoff on 408/429/5xx, and a token-bucket rate limiter that respects your plan’s ceiling. Pick the one that matches your stack and skip the raw fetch code.
| Surface | Package | Install |
|---|---|---|
| Node.js / TypeScript | chocodata | npm install chocodata |
| Python | chocodata | pip install chocodata |
| Go | github.com/Chocodata-com/chocodata-go | go get github.com/Chocodata-com/chocodata-go |
| CLI (any language) | chocodata-cli | npm install -g chocodata-cli |
| MCP server (AI agents) | chocodata-mcp | npx chocodata-mcp |
Node / TypeScript
npm install chocodata
import { Chocodata } from "chocodata";
const chocodata = new Chocodata("cd_live_YOUR_KEY");
const product = await chocodata.product({
site: "walmart",
query: "5085206428",
});
console.log(product.title, product.price);
Typed responses, auto-pagination on Search, webhook-signature verification on Batch. Works in Node 18+ and any ESM/CJS setup. See the npm README for the full reference.
Python
pip install chocodata
from chocodata import Chocodata
chocodata = Chocodata(api_key="cd_live_YOUR_KEY")
product = chocodata.product(site="walmart", query="5085206428")
print(product["title"], product["price"])
Works on Python 3.9+. Sync and async variants ship side by side (chocodata.product vs await chocodata.product_async). Type hints via TypedDict.
Go
go get github.com/Chocodata-com/chocodata-go
package main
import (
"context"
"fmt"
"log"
chocodata "github.com/Chocodata-com/chocodata-go"
)
func main() {
client := chocodata.New("cd_live_YOUR_KEY")
data, err := client.Product(context.Background(), chocodata.ProductParams{
Site: "walmart",
Query: "5085206428",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(data.Title, data.Price)
}
Context-aware cancellation, idiomatic Go error wrapping, zero external deps beyond net/http.
CLI
The CLI is handy for quick one-off scrapes from a terminal or shell script.
npm install -g chocodata-cli
chocodata login cd_live_YOUR_KEY # stored in ~/.chocodata/config
# Single product
chocodata walmart product --query 5085206428
# Search
chocodata google search --query "laptop" --pages 2
# Pipe a list of IDs from a file
cat ids.txt | chocodata walmart product --json-per-line > out.ndjson
The CLI outputs JSON by default, or NDJSON (one row per line) with --json-per-line - easy to pipe into jq, awk, or a warehouse loader.
MCP server (Claude, Cursor, and other agents)
The MCP server exposes Chocodata as tools that an AI agent can call directly, so a coding agent or chat client can scrape the web without you writing glue code. It runs over stdio and works with any MCP-compatible client (Claude Desktop, Cursor, Windsurf, and others).
Add it to your client’s MCP config:
{
"mcpServers": {
"chocodata": {
"command": "npx",
"args": ["-y", "chocodata-mcp"],
"env": { "CHOCODATA_API_KEY": "cd_live_YOUR_KEY" }
}
}
}
The agent then has tools for the dedicated endpoints and the Universal Web Scraper API: point it at a site and resource, or hand it a URL, and it returns structured JSON. Pricing and the only-2xx billing rule are identical to the HTTP API.
Raw HTTP (no SDK)
For stacks we don’t publish an SDK for yet (Java, Ruby, PHP, C#), the API is a plain GET with your key in the ?api_key= query parameter. Every endpoint page has a cURL snippet you can port. Examples:
What the SDKs do that raw HTTP doesn’t
- Exponential backoff with jitter on 408 / 429 / 5xx.
- Client-side rate limiter so you don’t have to think about your plan’s ceiling.
- Webhook-signature verification (Batch endpoint) in one line.
- Typed response shapes - autocomplete every product field in your editor.
- Sensible defaults -
Accept-Encoding: gzip,User-Agentidentifying the SDK + version, a 30s request timeout you can override per call.
If you ever find the SDK doing something unexpected, pass debug: true at construction and you’ll get every HTTP call printed to stderr with timings.
Related
- Authentication - API key format and rotation
- Rate limits & concurrency - what the built-in limiter is protecting you from
- Error codes - what the SDK’s retry policy is reacting to