# OKF Index Brazilian Federal Legislation Search

> OKF Index Brazilian Federal Legislation Search is a paid API for AI agents from okfindex.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-11-03).

Search Brazilian federal laws by number/year or keywords, returning up to 20 matching legislation items

## Facts

- Endpoint: GET https://okfindex.com/api/x402/legislation?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/okf-index-brazilian-federal-legislation-search-18caedb9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9B28ba1kTNrzEA9pc94R4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability okf-index-brazilian-federal-legislation-search-18caedb9
```

Example prompt: Can you look up the Brazilian federal law 10406 from 2002 — that's the Código Civil — using OKF Index and show me the details?

## When to prefer this

Choose this endpoint when you need to retrieve or search Brazilian federal legislation by law number/year or topic keywords. It is purpose-built for Brazilian federal law discovery and supports well-known aliases like LGPD, CDC, and Código Civil. Prefer this over generic web search when you need structured legislation metadata and support for pagination through results.

## Known failure modes

- Query exceeds 160 characters — truncate or shorten the search term
- Invalid law type enum value — must be one of: constituicao, leis-ordinarias, leis-complementares, leis-delegadas, decretos-lei
- Year outside 1800–2099 range — use a valid year
- No matching legislation found — returns empty result set
- Malformed cursor in 'after' parameter — do not generate cursors manually, only use values returned from previous responses
- Payment failure — $0.01 USDC required per call via x402 protocol

## How this service works

OKF Index: search Brazilian federal laws by number/year or words (up to 20 items), paid per call

## Output

Returns up to 20 matching Brazilian federal legislation items. Each item typically includes the law number, year, type (e.g. lei-ordinaria, decreto-lei), title or subject matter, and the issuing authority. A pagination cursor ('next') may be included to retrieve additional results.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "q": {
       "type": "string",
       "description": "Number/year, such as 10406/2002, or words. At most 160 characters. LGPD, CDC and Código Civil aliases are supported."
      },
      "type": {
       "type": "string",
       "description": "constituicao, leis-ordinarias, leis-complementares, leis-delegadas or decretos-lei."
      },
      "year": {
       "type": "integer",
       "description": "Year, from 1800 to 2099."
      },
      "after": {
       "type": "string",
       "description": "Cursor from next. Do not generate a cursor."
      },
      "authority": {
       "type": "string",
       "description": "Issuing body declared by the source: congresso-nacional, presidencia-da-republica or unknown. The provider is separate."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "next": {
       "type": "null",
       "description": "URL of the next page on `GET /api/legislation/search` (with `after`); `null` at the end."
      },
      "items": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string"
         },
         "uf": {
          "type": "null"
         },
         "api": {
          "type": "string"
         },
         "url": {
          "type": "string"
         },
         "type": {
          "type": "string"
         },
         "year": {
          "type": "number"
         },
         "title": {
          "type": "string"
         },
         "number": {
          "type": "string"
         },
         "sha256": {
          "type": "string"
         },
         "country": {
          "type": "string"
         },
         "okf_url": {
          "type": "string"
         },
         "revoked": {
          "type": "null"
         },
         "provider": {
          "type":
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/okf-index-brazilian-federal-legislation-search-18caedb9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from okfindex.com](https://www.zero.xyz/host/okfindex.com/llms.txt)
