
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
TypeScript/JavaScript SDK for the Infomance API
SDK TypeScript/JavaScript para a API Infomance
Brazilian municipalities socioeconomic and geospatial data.
Dados socioeconômicos e geoespaciais de municípios brasileiros.
npm install infomance
import { InfomanceClient } from 'infomance';
const client = new InfomanceClient({
apiKey: 'your-api-key',
});
// Get municipality indicators
const saopaulo = await client.getMunicipality('3550308');
console.log(saopaulo);
// List municipalities
const municipalities = await client.listMunicipalities({ state: 'SP', limit: 10 });
console.log(municipalities.items);
// Get consolidated data (all data in one call)
const consolidated = await client.getConsolidatedCity('3550308');
console.log(consolidated);
// List municipalities with economic indicators
const municipalities = await client.listMunicipalities({
state: 'SP',
limit: 100
});
// Get detailed municipality data
const municipality = await client.getMunicipality('3550308');
// Get economic data
const economic = await client.getMunicipalityEconomic('3550308');
// Get infrastructure data (sanitation, internet)
const infra = await client.getMunicipalityInfrastructure('3550308');
// Get rankings
const pibRanking = await client.getIndicatorsRanking('pib', {
limit: 10,
state: 'SP'
});
// Get export overview
const overview = await client.getComexOverview();
// Get municipality exports
const exports = await client.getComexMunicipality('3550308');
// Get export timeseries
const timeseries = await client.getComexMunicipalityTimeseries('3550308');
// Get products list
const products = await client.getComexProducts({ limit: 20 });
// Get export rankings
const ranking = await client.getComexRanking('value_usd', { limit: 10 });
// Get rural credit overview
const overview = await client.getSicorOverview();
// Get state data
const spData = await client.getSicorState('SP');
// Get by purpose/activity
const byFinalidade = await client.getSicorByFinalidade();
const byAtividade = await client.getSicorByAtividade();
// List health establishments
const establishments = await client.listHealthEstablishments({
state: 'SP',
type: 'hospital',
limit: 50
});
// Get specific establishment
const hospital = await client.getHealthEstablishment('2077485');
// Get municipality health stats
const healthStats = await client.getMunicipalityHealthStats('3550308');
// Search establishments
const results = await client.searchHealthEstablishments('einstein');
// List schools
const schools = await client.listSchools({
state: 'SP',
network: 'municipal'
});
// Get IDEB rankings
const idebRanking = await client.getIDEBRanking({ limit: 20 });
// Get municipality education data
const education = await client.getMunicipalityEducation('3550308');
// Get crime statistics
const crimeStats = await client.listCrimeStats({ state: 'SP', year: 2023 });
// Get overview
const overview = await client.getSecurityOverview();
// Get municipality crime data
const cityCrimes = await client.getMunicipalityCrimeStats('sao_paulo');
// List agricultural municipalities
const municipalities = await client.listAgroMunicipalities({ state: 'MT' });
// Get municipality agricultural data
const agro = await client.getAgroMunicipality('5103403');
// Get land use (MapBiomas)
const landUse = await client.getAgroLandUse('5103403');
// Get emissions (SEEG)
const emissions = await client.getAgroEmissions('5103403');
// Search POIs
const pois = await client.searchPOIs({
city: 'sao_paulo',
category: 'restaurant',
limit: 20
});
// Search nearby
const nearby = await client.searchNearbyPOIs(-23.55, -46.63, 1000, {
category: 'bank'
});
// Get city POI stats
const stats = await client.getCityPOIStats('sao_paulo');
Get all data about a city in a single call:
const city = await client.getConsolidatedCity('3550308');
console.log(city.indicators);
console.log(city.health);
console.log(city.education);
console.log(city.security);
console.log(city.employment);
console.log(city.agro);
// Export to CSV
const csv = await client.exportToCSV('/api/v1/indicators/municipalities', {
state: 'SP',
limit: 100
});
// Export to Excel
const excel = await client.exportToExcel('/api/v1/comex/products', {
year: 2024
});
import { InfomanceClient, InfomanceError } from 'infomance';
try {
const data = await client.getMunicipality('invalid-code');
} catch (error) {
if (error instanceof InfomanceError) {
console.error(`API Error ${error.status}: ${error.message}`);
} else {
console.error('Network error:', error);
}
}
const client = new InfomanceClient({
apiKey: 'your-api-key', // Required - get yours at infomance.com.br
baseUrl: 'https://api.infomance.com.br', // Optional (default)
timeout: 30000, // Request timeout in ms (default: 30000)
});
The SDK is fully typed. All response types are exported:
import {
Municipality,
MunicipalityIndicators,
HealthEstablishment,
School,
POI,
// ... and more
} from 'infomance';
Never hardcode your API key in source code. Use environment variables:
Nunca hardcode sua API key no código. Use variáveis de ambiente:
import { InfomanceClient } from 'infomance';
const apiKey = process.env.INFOMANCE_API_KEY;
if (!apiKey) {
throw new Error('INFOMANCE_API_KEY not set');
}
const client = new InfomanceClient({ apiKey });
The SDK never logs your API key. When using the logger option, only the following is logged:
O SDK nunca loga sua API key. Ao usar a opção logger, apenas o seguinte é logado:
const client = new InfomanceClient({
apiKey: process.env.INFOMANCE_API_KEY!,
logger: console, // Safe - API key is never logged
});
All connections use HTTPS with TLS certificate verification. The SDK does not provide an option to disable SSL verification.
Todas as conexões usam HTTPS com verificação de certificado TLS. O SDK não oferece opção para desabilitar a verificação SSL.
| Plan | Requests/month |
|---|---|
| Free | 1,000 |
| Starter | 10,000 |
| Professional | 50,000 |
| Business | 200,000 |
FAQs
Official SDK for Infomance API - Municipal data for Brazil and Europe
The npm package infomance receives a total of 12 weekly downloads. As such, infomance popularity was classified as not popular.
We found that infomance demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.