BYTETOOLS

Senado Federal (Brazil) API

Free Brazilian Senate API with no key: every serving senator with photo, party, state and mandate details, served as JSON converted from an XSD-validated XML schema. Tested example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the Senado Federal (Brazil) API?

The Senado Federal open data service publishes Brazil's upper house as free, key-free data. Appending `.json` to any endpoint returns the senators currently in exercise with party, state and contact details, alongside a metadata block naming the service version and linking its XML schema.

This service was designed XML-first and gained JSON later, and the shape makes that history obvious. The root is a single named wrapper — `ListaParlamentarEmExercicio` — containing a `Metadados` block and then `Parlamentares.Parlamentar`, an array nested two levels deep for no reason other than faithfully mirroring the XML tree. Field names are PascalCase (`NomeParlamentar`, `CodigoParlamentar`, `UrlFotoParlamentar`) rather than the camelCase used by the Chamber of Deputies, so the two Brazilian chambers cannot share a client.

The `Metadados` block is worth reading rather than skipping past. It carries a `Versao` timestamp updated on every regeneration, a `VersaoServico` number, the date that service version was released and a Portuguese description of the dataset. It also links `noNamespaceSchemaLocation`, the XSD defining the structure — genuinely useful, because it lets you generate typed models instead of guessing which fields are optional. Where a single senator matches rather than a list, the `Parlamentar` value collapses from an array to an object, which is the classic XML-to-JSON hazard.

Quick facts

Base URL
https://legis.senado.leg.br/dadosabertos
Authentication
No API key or registration. Append `.json` to any path for JSON; omit it and you get the original XML.
Rate limit
No published limit. Lists are small — the Senate has 81 seats — so cache and re-fetch daily at most.
Pricing
Free. Brazilian legislative data is public information.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Senado Federal (Brazil) API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. List currently serving Brazilian senators

GET https://legis.senado.leg.br/dadosabertos/senador/lista/atual.json

curl
curl 'https://legis.senado.leg.br/dadosabertos/senador/lista/atual.json'
JavaScript (fetch)
const res = await fetch("https://legis.senado.leg.br/dadosabertos/senador/lista/atual.json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://legis.senado.leg.br/dadosabertos/senador/lista/atual.json", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "ListaParlamentarEmExercicio": {
    "noNamespaceSchemaLocation": "https://legis.senado.leg.br/dadosabertos/dados/ListaParlamentarEmExerciciov4.xsd",
    "Metadados": {
      "Versao": "21/08/2026 04:59:54",
      "VersaoServico": "4",
      "DataVersaoServico": "2020-07-15",
      "DescricaoDataSet": "Lista dos Parlamentares que estão atualmente em Exercício. Informações atuais sobre o Parlamentar."
    },
    "Parlamentares": {
      "Parlamentar": [
        {
          "IdentificacaoParlamentar": {
            "CodigoParlamentar": "5672",
            "CodigoPublicoNaLegAtual": "800",
            "NomeParlamentar": "Alan Rick",
            "NomeCompletoParlamentar": "Alan Rick Miranda",
            "SexoParlamentar": "Masculino",
            "FormaTratamento": "Senador ",
            "UrlFotoParlamentar": "http://www.senado.leg.br/senadores/img/fotos-oficiais/senador5672.jpg",
            "UrlPaginaParlamentar": "http://www25.senado.leg.br/web/senadores/senador/-/perfil/5672",
            "EmailParlamentar": "sen.alanrick@senado.leg.br",
            "Telefones": {
              "Telefone": [
                {
                  "NumeroTelefone": "33036333",
                  "OrdemPublicacao": "1",
                  "IndicadorFax": "Não"
                }
              ]
            },
            "SiglaPartidoParlamentar": "REPUBLICANOS",
            "UfParlamentar": "AC",
            "Bloco": {
              "CodigoBloco": "346",
              "NomeBloco": "Bloco Parlamentar Aliança",
              "NomeApelido": "BLALIANÇA",
              "DataCriacao": "2023-03-20"

Parameters

ParameterTypeRequiredDescription
/senador/lista/atual.jsonpathOptionalSenators currently in exercise. /senador/lista/atual.json
/senador/{codigo}.jsonpathOptionalFull detail for one senator by their CodigoParlamentar. /senador/5672.json
/materia/{sigla}/{numero}/{ano}.jsonpathOptionalA specific bill or legislative matter. /materia/PL/1234/2024.json
/plenario/lista/votacao/{data}.jsonpathOptionalPlenary votes on a given date. /plenario/lista/votacao/20240315.json

Response fields

ListaParlamentarEmExercicioobject
Single named root wrapper. Every Senate endpoint wraps its payload in a differently named root.
Metadados.Versaostring
Regeneration timestamp, updated each time the document is rebuilt.
Metadados.VersaoServico / DataVersaoServicostring
Service contract version and its release date — check before relying on field stability.
Metadados.noNamespaceSchemaLocationstring
URL of the XSD defining the structure. Use it to generate typed models.
Parlamentares.Parlamentararray or object
The senators, nested two levels deep. Collapses to a single object when only one record matches.
IdentificacaoParlamentar.CodigoParlamentarstring
Senator identifier, published as a string despite being numeric. Key for every other endpoint.
IdentificacaoParlamentar.NomeParlamentar / NomeCompletoParlamentarstring
Parliamentary name and full legal name.
IdentificacaoParlamentar.FormaTratamentostring
Form of address, such as `Senador `. Note the trailing space in the published value.
IdentificacaoParlamentar.UrlFotoParlamentarstring
Official portrait URL, served over plain HTTP in the published data.

What you can build with the Senado Federal (Brazil) API

  • Build a directory of Brazilian senators with photos and parties
  • Track Senate voting records on legislation
  • Follow a bill through the upper house
  • Compare Senate and Chamber composition by party

Common errors and how to fix them

XML instead of JSON

The `.json` suffix was omitted.

Fix: Append `.json` to the path. Content negotiation through Accept headers is not supported.

Iteration fails on a single result

`Parlamentar` collapses from array to object when one record matches.

Fix: Normalise with an array check before iterating — the standard XML-to-JSON single-element problem.

Field names not found

They are PascalCase Portuguese, unlike the Chamber of Deputies API.

Fix: Use `NomeParlamentar`, `CodigoParlamentar` and so on; the two chambers share no naming convention.

Trailing spaces in values

Fields such as `FormaTratamento` carry padding from the source system.

Fix: Trim string values before comparing or displaying them.

Senado Federal (Brazil) API — frequently asked questions

Is the Senado Federal API free?

Yes, no key and no registration. Append `.json` to any documented path for JSON output, or leave it off for the original XML.

Why is the JSON structured so awkwardly?

It is a direct conversion of an XML service, so the named root wrapper, the two-level nesting under `Parlamentares.Parlamentar` and the PascalCase field names all mirror the XML tree rather than following JSON conventions.

Can I use the same client as the Chamber of Deputies API?

No. The Chamber uses camelCase keys under a `dados` array with HATEOAS links; the Senate uses PascalCase under a named root with no link relations. They are separate services that happen to cover the same parliament.

What is the XSD link for?

`noNamespaceSchemaLocation` points at the schema defining the response structure, so you can generate typed models and know which fields are genuinely optional instead of inferring it from samples.

Tools that pair with this API

Senado Federal (Brazil) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.