Egg Count API

Consult and send ovitrap, block and field visit data directly from your system. This page documents all available public and private endpoints.

/en-ca/apiRequest API Key

About the API

This API has endpoints public and private. The public API returns data on latitude, longitude and number of eggs for each participating municipality over time, without the need for authentication. The private API is only recommended for applications that work in partnership with Conta Ovos, as it exposes sensitive data and allows you to insert, change and remove records.

Authentication and keys

To use the private API you will need an access key (key). To purchase it, send an email to contaovosdengue@gmail.com stating:

  • Why do you need API access;
  • What level of access is required (municipal, regional, state or country);
  • Which geographic region are you part of?

The key is made up of 45 random letters and must be sent in the parameter key of each private request. The geographic scope and plan linked to the key (api_access_municipality_id, state_id, region_id, country_id, plan) automatically define which records it can read or change — a municipal key, for example, can only read or modify data from the municipality itself.

Pagination: the parameters page accept a maximum of 100 on endpoints that support paging. Invalid or missing values ​​take page 1.

Response Codes

All endpoints follow the same HTTP status pattern:

CodeMeaning
200Request processed successfully.
400Mandatory parameter missing or in invalid format.
403The resource informed does not belong to the scope (city/state/region) of the key used.
404Invalid key (Wrong key) or resource not found.
409A record already exists for this identifier, year, and week combination.
500Internal error processing the request.

Public Endpoints

GET/api/lastcountingpublicPublic

Latest released counts

Returns the latest counts released by location (city, state or country), with the number of eggs and ovitrap data.

Parameters

NameTypeDescription
statestringState code. Example: state=RJ.
municipalitystringName of the municipality. Example: municipality=Ponta Pora
countrystringCountry name. Example: country=Brasil. If omitted, assumes "Brazil".
pageintPagination page (default 1, maximum 100).
idintDisplays only occurrences from the given id. Example: id=7876.
datedateDisplays occurrences from the date of inclusion. Example: date=2025-01-01.
date_collectdateDisplays occurrences from the collection date onwards. Example: date_collect=2024-12-12.
date_startdateStart date to filter the counts. Example: date_start=2025-01-01.
date_enddateEnd date to filter counts. Example: date_end=2025-12-31.

Note: If no location parameters are sent, the endpoint returns the latest counts from Brazil.

Request example

curl -G -d "municipality=Ponta%20Pora" \ /en-ca/api/lastcountingpubliccurl -G -d "state=MG" \ /en-ca/api/lastcountingpublic

Sample answer

[ { "state_name": "Minas Gerais", "state_code": "MG", "municipality": "Ponta Pora", "municipality_code": "5006606", "eggs": 42, "week": 3, "year": 2025, "time": "2025-01-20 14:32:10", "counting_id": 118342, "ovitrap_website_id": 981, "ovitrap_id": "97", "latitude": -7.000000, "longitude": -8.000000, "date": "2025-01-20", "date_collect": "2025-01-27" }]
GET/api/getmunicipalityblockspublicPublic

Latest actions in blocks

Returns data on actions (treatment visits) carried out in blocks.

Parameters

NameTypeDescription
statestringState code. Example: state=RJ.
municipalitystringName of the municipality. Example: municipality=Ponta Pora
countrystringCountry name. Example: country=Brasil. If omitted, assumes "Brazil".
pageintPagination page (default 1, maximum 100).

Request example

curl -G -d "municipality=Vista%20Alegre" \ /en-ca/api/getmunicipalityblockspubliccurl -G -d "state=MS" \ /en-ca/api/getmunicipalityblockspublic

Sample answer

[ { "block_id": 4521, "block_actions_mean": 3.4, "block_coordinates": "[[-7.123, -34.845], [-7.124, -34.846]]", "municipality": "Vista Alegre", "municipality_code": "5007117", "state_name": "Mato Grosso do Sul", "state_code": "MS", "action_land_total_total": 21, "action_land_residence_total": 10, "action_land_commercial_total": 5, "action_land_empty_total": 3, "action_land_strategy_total": 1, "action_land_another_total": 2, "action_address_district": "Centro", "action_address_sector": "Setor 04", "action_deposit_a1_quantity": 4, "action_deposit_a2_quantity": 2, "action_deposit_b_quantity": 5, "action_deposit_c_quantity": 1, "action_deposit_d1_quantity": 0, "action_deposit_d2_quantity": 3, "action_deposit_e_quantity": 0, "action_observation": "Foco encontrado em pneus nos fundos do imovel.", "latitude": -7.123456, "longitude": -34.845678 }]

Private Endpoints

All endpoints below require the parameter key with your API key.

GET/api/lastcountingPrivate

Latest released counts

Returns the last counts released within the scope of the key, with number of eggs, ovitrap data and the responsible user.

Parameters

NameTypeDescription
keystringYour API key. Defines the scope of the returned counts.
pageintPagination page (default 1, maximum 100).
date_startdateStart date to filter the counts. Example: date_start=2025-01-01.
date_enddateEnd date to filter counts. Example: date_end=2025-12-31.

Request example

curl -G -d "key=KEY&page=1" \ /en-ca/api/lastcounting

Sample answer

[ { "state_name": "Minas Gerais", "state_code": "MG", "municipality": "Ponta Pora", "municipality_code": "5006606", "eggs": 42, "week": 3, "year": 2025, "time": "2025-01-20 14:32:10", "user": "Joao da Silva", "counting_id": 118342, "ovitrap_website_id": 981, "ovitrap_id": "97", "district": "Centro", "street": "Rua das Flores", "number": "123", "complement": "", "loc_inst": "", "sector": "Setor 04", "latitude": -7.000000, "longitude": -8.000000, "date": "2025-01-20", "date_collect": "2025-01-27" }]
POST/api/postcountingPrivate

Read submission

Sends the reading of an ovitrap. It is possible to send data to an existing ovitrap or send the data and install a new ovitrap at the same time.

Parameters

NameTypeDescription
keystringYour API key. Defines the scope of the submission.

Request example

curl -X POST -d "key=KEY" \ /en-ca/api/postcounting

For standard shipping, where it is not necessary to install a new ovitrap, send the following fields (all mandatory) in the body of the request (form):

{ "ovitrap_group_id": 97, "ovitrap_lat": -7.000000, "ovitrap_lng": -8.000000, "date": "2025-01-20", "counting_observation_id": 1, "counting_observation": "caso o counting_observation_id seja 9", "counting_eggs": 5}

Table with the IDs of each type of observation (counting_observation_id):

IDMeaning
1No observations
2Interval between installation and collection longer than expected
3Ovitrap or missing palette
4Ovitrap or broken palette
5Ovitrap or palette removed
6Dry ovitrap
7Closed house
8Ovitrap filled with water
9Ovitrap with little water
10Another observation

To install a new ovitrap next to the shipment, mandatory the fields: ovitrap_lat, ovitrap_lng, ovitrap_group_id

{ "ovitrap_group_id": 96, "ovitrap_address_district": "Distrito", "ovitrap_address_street": "Rua", "ovitrap_address_number": "Numero", "ovitrap_address_complement": "Complemento", "ovitrap_address_loc_inst": "", "ovitrap_lat": -7.000000, "ovitrap_lng": -8.000000, "ovitrap_address_sector": "Setor", "ovitrap_responsable": "Responsavel", "ovitrap_block_id": "Quarteirao", "date": "2025-01-20", "counting_date_collect": "2025-01-27", "counting_observation_id": 1, "counting_observation": "caso o counting_observation_id seja 9", "counting_eggs": 5}
Specific answers:
  • 400 — when any of the mandatory fields is not sent: ovitrap_lat, ovitrap_lng, ovitrap_group_id
  • 404 — There is already a count for this ovitrap, year and week.
POST/api/postdeletecountingPrivate

Delete reading

Removes reading from an ovitrap.

Parameters

NameTypeDescription
keystringYour API key. Defines the scope of removal.

Request example

curl -X POST -d "key=KEY" \ /en-ca/api/postdeletecounting

Data required in the body of the request (form):

{ "ovitrap_group_id": 97, "date": "2025-01-20"}
POST/api/postdeleteovitrapPrivate

Delete ovitrap

Remove an ovitrap.

Parameters

NameTypeDescription
keystringYour API key.

Request example

curl -X POST -d "key=KEY" \ /en-ca/api/postdeleteovitrap

Data required in the body of the request (form):

{ "ovitrap_group_id": 97}
POST/api/postactionPrivate

Insert visit

Register a visit/action in a block. To add the visit to an existing block, send the field block_id. If it does not exist, use block_group_id — the system will create the block automatically. This endpoint only allows the insertion of blocks that are within the applicant's municipality.

Parameters

NameTypeDescription
keystringYour API key.

Request example

curl -X POST -d "key=KEY" \ /en-ca/api/postaction

Data sent in form or query parameters, using block_id:

{ "block_id": 97, "date": "2025-01-20", "block_land_residence": 10, "action_land_residence_out": 2, "action_land_residence_breedings": 1, "action_land_residence_treated": 1, "block_land_commercial": 5, "action_land_commercial_out": 0, "action_land_commercial_breedings": 0, "action_land_commercial_treated": 0, "block_land_empty": 3, "action_land_empty_out": 1, "action_land_empty_breedings": 2, "action_land_empty_treated": 1, "block_land_strategy": 1, "action_land_strategy_out": 0, "action_land_strategy_breedings": 0, "action_land_strategy_treated": 0, "block_land_special": 0, "action_land_special_out": 0, "action_land_special_breedings": 0, "action_land_special_treated": 0, "block_land_another": 2, "action_land_another_out": 0, "action_land_another_breedings": 0, "action_land_another_treated": 0, "action_deposit_a1_quantity": 4, "action_deposit_a1_eliminated": 2, "action_deposit_a1_treated": 1, "action_deposit_a1_larvicid": 10, "action_deposit_a2_quantity": 2, "action_deposit_a2_eliminated": 1, "action_deposit_a2_treated": 0, "action_deposit_a2_larvicid": 0, "action_deposit_b_quantity": 5, "action_deposit_b_eliminated": 5, "action_deposit_b_treated": 0, "action_deposit_b_larvicid": 0, "action_deposit_c_quantity": 1, "action_deposit_c_eliminated": 0, "action_deposit_c_treated": 1, "action_deposit_c_larvicid": 5, "action_deposit_d1_quantity": 0, "action_deposit_d1_eliminated": 0, "action_deposit_d1_treated": 0, "action_deposit_d1_larvicid": 0, "action_deposit_d2_quantity": 3, "action_deposit_d2_eliminated": 1, "action_deposit_d2_treated": 2, "action_deposit_d2_larvicid": 15, "action_deposit_e_quantity": 0, "action_deposit_e_eliminated": 0, "action_deposit_e_treated": 0, "action_deposit_e_larvicid": 0, "action_observation": "Visita realizada conforme cronograma. Foco encontrado em pneus nos fundos do imovel."}

Opting for block_group_id (block not yet registered), also send the data of the block itself:

{ "block_group_id": 97, "date": "2025-01-20", "block_address_district": "Centro Historico", "block_address_sector": "Setor 04 - Norte", "block_coordinates": "[[-7.123, -34.845], [-7.124, -34.846]]", "block_lat": -7.123456, "block_lng": -34.845678, "block_responsable": "Joao da Silva", "block_land_residence": 10, "action_land_residence_out": 2, "action_land_residence_breedings": 1, "action_land_residence_treated": 1, "block_land_commercial": 5, "action_land_commercial_out": 0, "action_land_commercial_breedings": 0, "action_land_commercial_treated": 0, "block_land_empty": 3, "action_land_empty_out": 1, "action_land_empty_breedings": 2, "action_land_empty_treated": 1, "block_land_strategy": 1, "action_land_strategy_out": 0, "action_land_strategy_breedings": 0, "action_land_strategy_treated": 0, "block_land_special": 0, "action_land_special_out": 0, "action_land_special_breedings": 0, "action_land_special_treated": 0, "block_land_another": 2, "action_land_another_out": 0, "action_land_another_breedings": 0, "action_land_another_treated": 0, "action_deposit_a1_quantity": 4, "action_deposit_a1_eliminated": 2, "action_deposit_a1_treated": 1, "action_deposit_a1_larvicid": 10, "action_deposit_a2_quantity": 2, "action_deposit_a2_eliminated": 1, "action_deposit_a2_treated": 0, "action_deposit_a2_larvicid": 0, "action_deposit_b_quantity": 5, "action_deposit_b_eliminated": 5, "action_deposit_b_treated": 0, "action_deposit_b_larvicid": 0, "action_deposit_c_quantity": 1, "action_deposit_c_eliminated": 0, "action_deposit_c_treated": 1, "action_deposit_c_larvicid": 5, "action_deposit_d1_quantity": 0, "action_deposit_d1_eliminated": 0, "action_deposit_d1_treated": 0, "action_deposit_d1_larvicid": 0, "action_deposit_d2_quantity": 3, "action_deposit_d2_eliminated": 1, "action_deposit_d2_treated": 2, "action_deposit_d2_larvicid": 15, "action_deposit_e_quantity": 0, "action_deposit_e_eliminated": 0, "action_deposit_e_treated": 0, "action_deposit_e_larvicid": 0, "action_observation": "Area com alta densidade de recipientes descartaveis."}
Specific answers:
  • 400 — when date is not sent or when one of the numeric fields is not a valid number.
  • 400 — when block_group_id is not sent when creating a new block.
  • 403 — when the block_id informed does not belong to the key municipality.
  • 409 — when there is already a visit for that block, year and week.
POST/api/postdeleteactionPrivate

Delete visit

Removes a visit from one block.

Parameters

NameTypeDescription
keystringYour API key.

Request example

curl -X POST -d "key=KEY" \ /en-ca/api/postdeleteaction

Data required in the body of the request (form):

{ "block_group_id": 97, "date": "2025-01-20"}
POST/api/postdeleteblockPrivate

Delete block

Removes a block.

Parameters

NameTypeDescription
keystringYour API key.

Request example

curl -X POST -d "key=KEY" \ /en-ca/api/postdeleteblock

Data required in the body of the request (form):

{ "block_group_id": 97}