API Reference

Base URL: http://localhost:8100/v1. All protected endpoints require X-API-Key: bbi_<your-key> header.

Quickstart

1. Get your free API key from /app/keys.

# Look up a company by CNPJ
curl https://brazil.ambern.dev/v1/company/12345678000195 \
  -H "X-API-Key: bbi_your_key_here"

# Search by state and sector
curl "https://brazil.ambern.dev/v1/search?state=SP&size=ME&limit=20" \
  -H "X-API-Key: bbi_your_key_here"

# Check PGFN debt + CGU sanctions (STARTER+)
curl https://brazil.ambern.dev/v1/company/12345678000195/compliance \
  -H "X-API-Key: bbi_your_key_here"

Every response wraps data in { "data": {...}, "meta": { "plan": "STARTER", "requests_remaining": 1847 } }. Errors use { "error": { "code": "...", "message": "...", "status": 422 } }.