search_gazettes
Search the full text of Brazilian municipal official gazettes using keywords, city filters, and date ranges to locate specific mentions, names, or legal notices.
Instructions
Search the text of published Brazilian municipal official gazettes.
Each result is one gazette (one city's official publication, one edition, one
date) with a short excerpt showing where `query` matched. This searches gazette
*content*, not city metadata — resolve a city name to its territory_id with
`search_cities` first.
`query` uses OpenSearch's "simple query string syntax": bare words are OR'd
together, a leading `+` requires a term, a leading `-` excludes it, and double
quotes match an exact phrase — e.g. '"João da Silva"' for an exact name, or
'+licitação +pregão' to require both terms together. An empty query returns
matching gazettes' metadata without excerpts.
`territory_ids` restricts the search to specific cities by their 7-digit IBGE ID
(from `search_cities` or `get_city`); omit it to search across all available
cities. `published_since` / `published_until` are inclusive ISO dates
(YYYY-MM-DD) bounding the gazette's publication date — leave both unset to search
the full available history. `size` is capped at 50 results per call; use `offset`
to page through more. `sort_by` defaults to relevance; use "descending_date" or
"ascending_date" to sort chronologically instead.
Example: to find mentions of "Empresa X" in Porto Alegre gazettes published
between January and July 2026, once territory_id "4314902" is known, call
search_gazettes(query='"Empresa X"', territory_ids=["4314902"],
published_since="2026-01-01", published_until="2026-07-31").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | ||
| query | No | ||
| offset | No | ||
| sort_by | No | relevance | |
| territory_ids | No | ||
| published_since | No | ||
| published_until | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gazettes | Yes | ||
| total_gazettes | Yes |