OBM - Open Brazil Market Busca API
Busque por nome, ticker ou CNPJ com `q`. A busca respeita o plano da chave.
Busque por nome, ticker ou CNPJ com `q`. A busca respeita o plano da chave.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/obm-com-br:obm-com-br-busca-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: OBM Busca API
version: 1.0.0
description: '# Primeira chamada
A API do OBM responde em `https://api.obm.com.br`. Para testar, copie a chave `sandbox` preenchida no campo de autenticação da documentação e defina `OBM_API_KEY` no seu terminal. A chave pública só abre os ativos de exemplo. Para usar a API no seu produto, peça uma chave própria. ```sh
curl -i ''https://api.obm.com.br/v1/equities/PETR4/prices'' \
-H "X-API-Key: ${OBM_API_KEY}"
```
O corpo da resposta tem esta estrutura:
```json
{
"data": [],
"reference_date": null,
"source": {"code": "b3", "name": "B3 S.A. — Brasil, Bolsa, Balcão", "url": "https://www.b3.com.br/pt_br/market-data-e-indices.htm"},
"meta": {"page": 1, "page_size": 100, "total": 0}
}
```
Os quatro campos da resposta:
- `data`: o objeto ou a lista pedida. - `reference_date`: a data do dado, não a hora da chamada. Vem nula quando não há observação. - `source`: de onde o dado veio. - `meta`: paginação, só nas listas. Use `page` e `page_size` para percorrer a série; o máximo por página é 200. Preços são números, datas seguem ISO 8601 e campos desconhecidos devem ser ignorados pelo cliente. Na `sandbox`, acompanhe `X-RateLimit-Remaining` nos cabeçalhos; as respostas não incluem `X-Quota-*`. Com uma chave própria, `X-Quota-Remaining` também informa quanto resta da cota mensal da conta, em mês civil UTC; a free tem ainda teto de 200 chamadas por dia UTC. 401 quer dizer chave ausente ou inválida. 403 quer dizer que a chave é válida mas não tem acesso, o que inclui ativo fora da `sandbox`. Em 429, aguarde o intervalo de `Retry-After` antes de repetir. A `sandbox` permite 10 chamadas por minuto por IP do visitante. Exemplos liberados: PETR4, HGLG11, BOVA11, AAPL34, CRA0250020E, PETR26, LTN_2029-01-01, NTN-B PRINCIPAL_2035-05-15 e o fundo 08507696000159. Índices ficam disponíveis com chave própria. Consulte `/v1/sources` para as fontes e `/status` para as datas de referência disponíveis. ## Postman, Insomnia e Bruno
Baixe a collection em `https://api.obm.com.br/postman.json` e importe o arquivo no Postman, Insomnia ou Bruno. O formato é o Postman v2.1, que os três leem. Depois de importar, preencha a variável `apiKey` da collection com a sua chave. A `sandbox` já vem pronta na documentação. A variável `baseUrl` aponta para `https://api.obm.com.br`. Cada pasta reúne as operações de uma classe de ativo. Os exemplos usam identificadores liberados na `sandbox`, exceto Índices e a série dedicada de classe de fundo, que exigem chave própria. As respostas autenticadas devolvem `X-RateLimit-Limit` e `X-RateLimit-Remaining`; o teste da collection confere o status 2xx e o cabeçalho de limite. Nos exemplos restritos, a `sandbox` valida o 403 esperado; com chave própria, o exemplo de classe também exige observações em `points`. Se a verificação de consumo estiver indisponível, a API devolve 503 com `Retry-After`, sem liberar chamadas ilimitadas. # Autenticação
Envie a chave em um dos cabeçalhos:
```http
Authorization: Bearer
```
```http
X-API-Key:
```
Se enviar os dois, `Authorization` prevalece. Com `Authorization` presente e sem o esquema `Bearer`, a chamada retorna 401, sem usar `X-API-Key`. Não coloque a chave na URL. As rotas de dados exigem chave. Respondem sem chave apenas `/`, `/status`, `/openapi.json`, `/docs`, `/llms.txt`, `/llms-full.txt`, `/agents.md`, `/.well-known/api-catalog`, `/postman.json` e `/robots.txt`. Não há leitura de dados sem chave. A demonstração usa a chave `sandbox` publicada no formulário de teste da documentação, limitada a 9 ativos e a 10 chamadas por minuto por IP; veja Limites e erros. Chaves de uso próprio têm prefixo `obm_live_` e a `sandbox`, `obm_sandbox_`. Chaves legadas trazem 32 caracteres `base62` depois do prefixo; as novas trazem três blocos separados por `_`, com o último sendo uma soma de verificação. Trate a chave como texto opaco e copie-a inteira. `obm_test_` está reservado.'
servers:
- url: https://api.obm.com.br
security:
- PublicBearer: []
- PublicAPIKey: []
tags:
- name: Busca
description: Busque por nome, ticker ou CNPJ com `q`. A busca respeita o plano da chave.
paths:
/v1/search:
get:
tags:
- Busca
summary: Buscar ativos
description: 'Busca no catálogo do OBM por nome, ticker, código de renda fixa ou CNPJ, respeitando as classes e os ativos permitidos pela chave. Os resultados acompanham os cadastros da CVM, da B3 e da ANBIMA incorporados ao catálogo.
Cabeçalhos nas respostas autenticadas:
- `X-RateLimit-Limit`: Limite por minuto; `unlimited` indica ausência de limite.
- `X-RateLimit-Remaining`: Saldo por minuto; `unlimited` indica ausência de limite.
- `X-Quota-Limit`: Cota mensal; plano sem limite: o cabeçalho `X-Quota-*` não é enviado.
- `X-Quota-Remaining`: Saldo mensal; só em planos com cota.
- `X-Quota-Reset`: Reinício mensal em ISO 8601, no fuso de São Paulo; só em planos com cota.
Em 429, `Retry-After` informa os segundos de espera. Falhas de autenticação ocorrem antes da medição de limites.'
operationId: search
parameters:
- name: q
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 200
title: Q
- name: types
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Types
- name: page
in: query
required: false
schema:
type: integer
minimum: 1
default: 1
title: Page
- name: page_size
in: query
required: false
schema:
type: integer
maximum: 200
minimum: 1
default: 100
title: Page Size
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SearchListEnvelope'
'401':
content:
application/problem+json:
schema:
properties:
type:
default: about:blank
title: Type
type: string
title:
title: Title
type: string
status:
title: Status
type: integer
detail:
title: Detail
type: string
instance:
title: Instance
type: string
required:
- title
- status
- detail
- instance
title: Problem
type: object
description: Unauthorized
'403':
content:
application/problem+json:
schema:
properties:
type:
default: about:blank
title: Type
type: string
title:
title: Title
type: string
status:
title: Status
type: integer
detail:
title: Detail
type: string
instance:
title: Instance
type: string
required:
- title
- status
- detail
- instance
title: Problem
type: object
description: Forbidden
'404':
content:
application/problem+json:
schema:
properties:
type:
default: about:blank
title: Type
type: string
title:
title: Title
type: string
status:
title: Status
type: integer
detail:
title: Detail
type: string
instance:
title: Instance
type: string
required:
- title
- status
- detail
- instance
title: Problem
type: object
description: Not Found
'422':
content:
application/problem+json:
schema:
properties:
type:
default: about:blank
title: Type
type: string
title:
title: Title
type: string
status:
title: Status
type: integer
detail:
title: Detail
type: string
instance:
title: Instance
type: string
required:
- title
- status
- detail
- instance
title: Problem
type: object
description: Unprocessable Entity
'429':
content:
application/problem+json:
schema:
properties:
type:
default: about:blank
title: Type
type: string
title:
title: Title
type: string
status:
title: Status
type: integer
detail:
title: Detail
type: string
instance:
title: Instance
type: string
required:
- title
- status
- detail
- instance
title: Problem
type: object
description: Too Many Requests
'503':
content:
application/problem+json:
schema:
properties:
type:
default: about:blank
title: Type
type: string
title:
title: Title
type: string
status:
title: Status
type: integer
detail:
title: Detail
type: string
instance:
title: Instance
type: string
required:
- title
- status
- detail
- instance
title: Problem
type: object
description: Service Unavailable
x-codeSamples:
- lang: Shell
label: curl
source: "curl -i 'https://api.obm.com.br/v1/search?q=PETR4' \\\n -H \"X-API-Key: ${OBM_API_KEY}\""
- lang: Python
label: Python (httpx)
source: "import os\nimport httpx\n\nresponse = httpx.get(\"https://api.obm.com.br/v1/search?q=PETR4\",\n headers={\"X-API-Key\": os.environ[\"OBM_API_KEY\"]},\n timeout=30.0)\nresponse.raise_for_status()\nprint(response.json())"
- lang: JavaScript
label: JavaScript (fetch)
source: "const key = process.env.OBM_API_KEY;\nconst response = await fetch(\"https://api.obm.com.br/v1/search?q=PETR4\", {\n headers: { \"X-API-Key\": key }\n});\nif (!response.ok) throw new Error(await response.text());\nconsole.log(await response.json());"
components:
schemas:
Pagination:
properties:
page:
type: integer
minimum: 1.0
title: Page
page_size:
type: integer
maximum: 200.0
minimum: 1.0
title: Page Size
total:
type: integer
minimum: 0.0
title: Total
type: object
required:
- page
- page_size
- total
title: Pagination
SearchItem:
properties:
identifier:
type: string
title: Identifier
name:
type: string
title: Name
type:
type: string
title: Type
type: object
required:
- identifier
- name
- type
title: SearchItem
SearchListEnvelope:
properties:
data:
items:
$ref: '#/components/schemas/SearchItem'
type: array
title: Data
description: Dados da resposta. Os exemplos são ilustrativos e não representam cotações atuais.
reference_date:
anyOf:
- type: string
format: date
- type: 'null'
title: Reference Date
description: Data do dado no formato AAAA-MM-DD (RFC 3339); null quando não há data verificável. Nunca é a data da chamada.
source:
$ref: '#/components/schemas/Source'
meta:
anyOf:
- $ref: '#/components/schemas/Pagination'
- type: 'null'
type: object
required:
- data
- reference_date
- source
title: SearchListEnvelope
Source:
properties:
code:
type: string
title: Code
name:
type: string
title: Name
url:
type: string
title: Url
type: object
required:
- code
- name
- url
title: Source
securitySchemes:
PublicBearer:
type: http
scheme: bearer
PublicAPIKey:
type: apiKey
in: header
name: X-API-Key