The RulingLens API and MCP server

Everything the page does, for integrators: one call for a product, one upload for a quarter of entries. Six digits are the measured answer; the eight-digit line is for the broker's review; ten-digit statistical suffixes are listed from the schedule and never chosen. Nothing here names a code to file.

Keys

Sign in on the page → Account → API keys → New key. The key (rl_live_…) is shown once; the service keeps only its hash. Starter and above include the API; the free plan is the page only. Send it as a bearer token.

Calls

HTTP
GET  /v1/me                                plan, period, checks and audit lines left
POST /v1/classify   {"name": "...", "description": "..."}      → result (waits, ~20 s)
POST /v1/checks     same body               → {"id": ...} ; GET /v1/checks/{id} to collect
GET  /v1/checks?before=&q=                   history: finished checks, newest first, 50 a page
GET  /v1/checks.csv                          history as a spreadsheet, up to 5,000 rows
POST /v1/audits     multipart "file" (+ optional "mapping" JSON) or a raw body with X-Filename
GET  /v1/audits                             your audits
GET  /v1/audits/{id}                        status, counts, duty
GET  /v1/audits/{id}/report.{json|csv|xlsx|html}
GET  /v1/watch?hs6=420292                   Federal Register tariff actions naming the code or its heading, last 180 days
GET  /v1/webhooks · POST /v1/webhooks {url, events} · DELETE /v1/webhooks/{id} · POST /v1/webhooks/{id}/test   (docs/WEBHOOKS.md)
GET  /v1/openapi.json

A classify result carries recommendation (the six-digit code, the alternatives, the reliability block with the three nearest rulings and the mark), codes (the tariff's words for every code shown) and lines (the eight-digit rate lines under the recommendation, the most likely one for review, and each line's statistical suffixes).

Errors are JSON: {"error": "limit_reached", "message": "...", ...}. 422 refused_text means the description stated its own classification; remove the code and send it again.

Example:

Shell
curl -s https://rulinglens.com/v1/classify \
  -H "Authorization: Bearer rl_live_..." -H "Content-Type: application/json" \
  -d '{"name":"Tote bag","description":"Cotton canvas tote bag with two straps, unlined"}'

curl -s https://rulinglens.com/v1/audits \
  -H "Authorization: Bearer rl_live_..." -F file=@entries.csv \
  -F 'mapping={"description":"Item Description","filed_code":"HTS Number"}'

MCP server

Works in Claude Desktop, Claude Code, Cursor and anything else that speaks MCP over stdio. Python 3.11+, no other dependency.

Shell
pip install rulinglens-mcp        # or run without installing: uvx rulinglens-mcp

Claude Desktop (claude_desktop_config.json) or Cursor (.cursor/mcp.json):

JSON
{
  "mcpServers": {
    "rulinglens": {
      "command": "rulinglens-mcp",
      "env": { "RULINGLENS_API_KEY": "rl_live_..." }
    }
  }
}

Claude Code: claude mcp add rulinglens -e RULINGLENS_API_KEY=rl_live_... -- rulinglens-mcp

Tools: classify_product (name, description), audit_entries (path or base64 content, optional mapping), usage. Calls made this way are marked in the account's ledger as coming from the MCP server. The tool descriptions tell the assistant that no code is a code to file.

Limits

Per plan: Starter 500 checks a month; Pro 1,500 checks and 500 audit lines; Team 2,500 checks and 2,000 audit lines; a quarter audit bundle adds 2,000 lines for 90 days. Files up to 25 MB; audit lines per file up to the plan's monthly allowance. One check and one audit at a time per account. Every call is metered; the account page shows the period's use.