curl --request POST \
--url https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agregado": 1737
}
'import requests
url = "https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados"
payload = { "agregado": 1737 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agregado: 1737})
};
fetch('https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agregado' => 1737
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados"
payload := strings.NewReader("{\n \"agregado\": 1737\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agregado\": 1737\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agregado\": 1737\n}"
response = http.request(request)
puts response.read_body{
"agregado": 1737,
"observed_at_ms": 1790047010074,
"source_url": "https://servicodados.ibge.gov.br/api/v3/agregados/1737/periodos/-3/variaveis/63?localidades=N1[all]",
"value_count": 3,
"variaveis": [
{
"id": "63",
"resultados": [
{
"classificacoes": [],
"series": [
{
"localidade": {
"id": "1",
"nivel": {
"id": "N1",
"nome": "Brasil"
},
"nome": "Brasil"
},
"serie": {
"202606": "0.16",
"202607": "0.07",
"202608": "-0.32"
}
}
]
}
],
"unidade": "%",
"variavel": "IPCA - Variação mensal"
}
]
}Agregado dados
Official population or household count of a Brazilian municipality, state or the country (Census 2022: 4709/93 population, 4712/381 occupied households, 4712/382 residents in households; estimates: 6579/9324), IPCA (1737/63), PNAD unemployment (4099/4099), municipal GDP (5938/37), IPCA by group (7060/63 + classificacao 315) or any other table after agregado_metadados told you the ids. Resolve the municipality code first with localidades (e.g. São Bernardo do Campo = 3548708). Unknown agregado or variable ids are not_found; a level the table does not offer is invalid_input.
curl --request POST \
--url https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agregado": 1737
}
'import requests
url = "https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados"
payload = { "agregado": 1737 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agregado: 1737})
};
fetch('https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agregado' => 1737
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados"
payload := strings.NewReader("{\n \"agregado\": 1737\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agregado\": 1737\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agregado\": 1737\n}"
response = http.request(request)
puts response.read_body{
"agregado": 1737,
"observed_at_ms": 1790047010074,
"source_url": "https://servicodados.ibge.gov.br/api/v3/agregados/1737/periodos/-3/variaveis/63?localidades=N1[all]",
"value_count": 3,
"variaveis": [
{
"id": "63",
"resultados": [
{
"classificacoes": [],
"series": [
{
"localidade": {
"id": "1",
"nivel": {
"id": "N1",
"nome": "Brasil"
},
"nome": "Brasil"
},
"serie": {
"202606": "0.16",
"202607": "0.07",
"202608": "-0.32"
}
}
]
}
],
"unidade": "%",
"variavel": "IPCA - Variação mensal"
}
]
}Request contract
- Method and path: POST /apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados
{
"operationId": "servicodados-ibge-gov-br.official-statistics.agregado-dados",
"method": "POST",
"path": "/apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-dados",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"examples": {
"provider": {
"summary": "Official provider example; checked against AIsa request constraints",
"value": {
"agregado": 1737,
"periodos": "-3",
"variaveis": [
63
]
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"agregado": {
"description": "SIDRA table id, e.g. 4709 (Census 2022 population), 4712 (Census 2022 occupied households), 6579 (population estimates), 1737 (IPCA).\n\nProvider reference: minimum 1.",
"type": "number"
},
"classificacao": {
"description": "classificacao",
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"localidades": {
"description": "Territorial selections; default N1 all (Brazil).",
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"periodos": {
"default": "-6",
"description": "`-N` (last N periods, default -6), `all`, one period (2024, 202408), a range (202401-202412) or a comma list (2020,2022). Pattern: ^(all|-[0-9]{1,3}|[0-9]{4,6}(-[0-9]{4,6})?(,[0-9]{4,6}(-[0-9]{4,6})?)*)$.\n\nProvider reference: default \"-6\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"variaveis": {
"description": "Variable ids from agregado_metadados; joined with `|` upstream. Omit for `allxp` (every variable except percentages).",
"items": {
"type": "number"
},
"type": "array",
"x-alexandria-option-metadata": {
"in": "body"
}
}
},
"required": [
"agregado"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based pricing. Default request estimate: $0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.Authorizations
Body
Response
Query a SIDRA table (/api/v3/agregados/{agregado}/periodos/{periodos}/variaveis/{variaveis}?localidades=...&classificacao=...): one or more variables, a period selector (-3 last three, 2024, 202401-202412, 2020,2022, all), one or more territorial levels each with explicit ids or all, and optional classification/category filters. This is the official source for municipal population and household counts (market sizing, demographics): Census 2022 resident population is agregado 4709 variavel 93, Census 2022 occupied private households (domicílios particulares permanentes ocupados) and their residents are agregado 4712 variaveis 381 and 382 (5930 = residents per household), and the yearly population estimates are agregado 6579 variavel 9324; select a municipality with localidades [{nivel: N6, ids: [7-digit IBGE code]}], a state with N3. Values come back as the source publishes them (strings; ..., -, X are SIDRA's not-available markers).
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
agregado | number | |
observed_at_ms | number | Unix epoch milliseconds when this program observed the response. |
source_url | string | The exact servicodados.ibge.gov.br request that produced this result. |
value_count | number | Number of (variable, classification, locality, period) cells returned. |
variaveis | object[] |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.