Skip to content

Brazil ๐Ÿ‡ง๐Ÿ‡ท ANAC Registry โ€‹

Namebr-anac-registry
CountryBrazil
Registration prefixPP- / PR- / PT- / PS- / PU-
Data sourcehttps://sistemas.anac.gov.br/dadosabertos/Aeronaves/RAB/dados_aeronaves.json
FormatJSON API (fixed URL, full register dump)
Run frequencyWeekly (Wednesday, 08:10 UTC)
Depends on Mictronics for ICAO hexYes โ€” this runner does not publish ICAO hex addresses; registrations (formatted from MARCA) are resolved via RediSearch against Mictronics records (idx:aircraft:mictronics). Must run after the mictronics runner.

How it works โ€‹

The full Registro Aeronรกutico Brasileiro (RAB) JSON dump is downloaded from a fixed URL (utf-8-sig decoded). Records are filtered to active registrations only โ€” rows with a cancellation date (DTCANC) set, or whose CDINTERDICAO starts with R or M, are excluded. The MARCA field (e.g. PPAJH) is reformatted into a hyphenated registration (PP-AJH). Registrations are resolved to icao_hex in batches of 100 via RediSearch against the Mictronics index, then a type sanity check compares tokens from DSMODELO against the existing Mictronics record, rejecting the match only when both sides have tokens and none overlap. CDCLS is a compact 3-character code ({landing}{engine count}{propulsion}, or the literal RPA for drones) decoded into aircraft.type, aircraft.category, and the powerplant count/type. The embedded PROPRIETARIOSJSON owner list uses a non-standard /"" escape sequence for embedded quotes that is un-escaped before json.loads; only the first owner's name is kept, and placeholder values like Indisponรญvel are treated as absent. Unlike the other runners in this batch, writes to Redis here are per-record (not pipelined). Every written record explicitly sets military: false โ€” this register is exclusively civil, and the explicit value ensures a stale military: true flag (from Mictronics or a prior record on a reused hex) is corrected on re-registration.

Whenever a record has an aircraft.type_designator, aircraft:type:{type_designator} is looked up in Redis (populated by the mictronics runner) and, if found, its manufacturer_model and description_code (ICAO Doc 8643 description code, e.g. L2J) are set directly on this record โ€” unconditionally, regardless of whether Mictronics also has values for the same hex. This runner's own type_designator is sourced directly from ANAC and is authoritative; merge_aircraft.lua's "registry wins over mictronics" precedence rule guarantees these values take priority at read time either way. The lookup is not a hard dependency โ€” a missing reference table entry, or the table not existing yet, leaves the record exactly as it would have been without this step.

Columns โ€‹

Source columnImportedNotes
MARCAโœ…Reformatted to hyphenated registration (e.g. PPAJH โ†’ PP-AJH); used as the Mictronics lookup key
DTCANCโœ…Used only as a filter (non-empty = inactive, row skipped); not stored
CDINTERDICAOโœ…Used only as a filter (R/M prefix = inactive, row skipped); not stored
CDCLSโœ…Decoded into aircraft.type, aircraft.category, aircraft.powerplant.count, aircraft.powerplant.type
NMFABRICANTEโœ…โ†’ aircraft.manufacturer
DSMODELOโœ…โ†’ aircraft.model; also used for the type sanity check against Mictronics
CDTIPOICAOโœ…โ†’ aircraft.type_designator; also used to look up aircraft:type:{type_designator} in Redis, setting aircraft.manufacturer_model and aircraft.description_code when found
NRSERIEโœ…โ†’ aircraft.serial_number
NRASSENTOSโœ…โ†’ aircraft.seats
NRANOFABRICACAOโœ…โ†’ aircraft.manufactured_date (4-digit year โ†’ YYYY-01-01T00:00:00Z)
PROPRIETARIOSJSONโœ…โ†’ registrant.names[0]; embedded JSON with a non-standard quote escape; placeholder names (e.g. Indisponรญvel) are filtered
CDPROPOSITOCAVEโŒPresent in source; not read by this runner
CDTIPOโŒPresent in source; not read by this runner
CFOPERACIONALโŒPresent in source; not read by this runner
DSCATEGORIAHOMOLOGACAOโŒPresent in source; not read by this runner
DSGRAVAMEโŒPresent in source; not read by this runner
DSMOTIVOCANCโŒPresent in source; not read by this runner
DTVALIDADECAโŒPresent in source; not read by this runner
DTVALIDADECVAโŒPresent in source; not read by this runner
DT_MATRICULAโŒPresent in source; not read by this runner
NRCERTMATRICULAโŒPresent in source; not read by this runner
NRPASSAGEIROSMAXโŒPresent in source; not read by this runner
NRPMDโŒPresent in source; not read by this runner
NRTRIPULACAOMINโŒPresent in source; not read by this runner
OPERADORESJSONโŒPresent in source; not read by this runner
QTMOTORโŒPresent in source; not read by this runner
TPCAโŒPresent in source; not read by this runner
TPMOTORโŒPresent in source; not read by this runner
TPOPERADORโŒPresent in source; not read by this runner
TPPOUSOโŒPresent in source; not read by this runner

See specs/data-dictionary.yaml (br-anac-registry entry) for full column semantics and cross-source schema notes.

Example Output โ€‹

Read back the merged record for a given ICAO hex (combines this runner's data with Mictronics and any other sources that have written to the same key):

bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 E48DBF | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "category": "Land",
        "description_code": "L1P",
        "manufactured_date": "2006-01-01T00:00:00Z",
        "manufacturer": "BEECH AIRCRAFT",
        "manufacturer_model": "BEECH 36 Bonanza",
        "model": "G36",
        "powerplant": {
            "count": 1,
            "type": "Piston"
        },
        "seats": 6,
        "serial_number": "E3722",
        "type": "Airplane",
        "type_designator": "BE36"
    },
    "data_sources": [
        "mictronics",
        "br-anac-registry"
    ],
    "icao_hex": "E48DBF",
    "military": false,
    "registrant": {
        "names": [
            "MARCELO BERNARDINO GUARNIERI"
        ]
    },
    "registration": "PP-OCC"
}
bash
docker run --rm --network host redis:latest redis-cli EVAL "$(cat ./shared/lua/merge_aircraft.lua)" 0 E47F21 | python3 -m json.tool --sort-keys --no-ensure-ascii
json
{
    "aircraft": {
        "category": "Land",
        "description_code": "L2J",
        "manufactured_date": "2005-01-01T00:00:00Z",
        "manufacturer": "BOEING COMPANY",
        "manufacturer_model": "BOEING 767-300",
        "model": "767-316F",
        "powerplant": {
            "count": 2,
            "type": "Turbo-jet"
        },
        "seats": 6,
        "serial_number": "34245",
        "type": "Airplane",
        "type_designator": "B763"
    },
    "data_sources": [
        "mictronics",
        "br-anac-registry"
    ],
    "icao_hex": "E47F21",
    "military": false,
    "registrant": {
        "names": [
            "LAN CARGO S.A."
        ]
    },
    "registration": "PR-ABD"
}

Configuration โ€‹

See Data Runners for the full list of environment variables every runner reads. This runner writes aircraft:registry:{icao_hex} with a fixed 14-day TTL (ENRICHMENT_TTL_SECONDS in shared/timing.py).

MQTT โ€‹

Published once, at the end of a run, to SkyFollower/runner/br-anac-registry/statistic/{name} (all retained):

Topic suffixValueFormat
records_importede.g. 271Integer as string
last_run_ate.g. 2026-07-07T14:32:01.123456+00:00ISO 8601 UTC
last_run_statusSuccess or FailureString

Home Assistant autodiscovery configs are also published (retained) to homeassistant/sensor/SkyFollower_runner_br_anac_registry_{name}/config for each of the three stats above.