# Compras.gov.br Multi-CATMAT Price History Export (`jpmarketdata/compras-gov-br-multi-catmat-price-export`) Actor

Export Brazilian Compras.gov.br historical material prices for multiple known CATMAT codes. Raw item prices, quantities, packaging, separate source dates and explicit coverage for spreadsheets and APIs.

- **URL**: https://apify.com/jpmarketdata/compras-gov-br-multi-catmat-price-export.md
- **Developed by:** [h ichi](https://apify.com/jpmarketdata) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 price lines

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Compras.gov.br Multi-CATMAT Price History Export

Send up to five known Brazilian CATMAT material codes and get raw purchase-item price histories in one flat table for your spreadsheet or database. Keep Portuguese source text, original units, package capacity, quantities and separate purchase/result/update dates. Independent tool, not affiliated with the Brazilian government.

### Input

`catalogCodes`:1–5 numeric CATMAT material codes as strings, default\["443435","269520"]. `lookbackDays`:1–1095, default365 calendar days ending today in UTC−03:00. Optional `dateFrom` and `dateTo` must both be YYYY-MM-DD and override rolling days, max1095 inclusive days. `maxItemsPerCode`:1–100, default100. Each code inspects one page of100: at most500 unique rows/run. Source order is not guaranteed newest-first. More than100 source matches for a code means partial coverage; narrow the date window or split saved inputs for larger histories. This reads the public Compras.gov.br price API only.

### Output

One flat row per unique validated source purchase-item price snapshot, suitable for JSON or CSV export. Source IDs are exact decimal strings, including large integers and supplied leading zeros; configure Excel identifier columns as text to avoid its automatic rounding. Material code/description, positive unitPrice, nullable quantity, supply unit/capacity, measure unit, SISPP/SISRP form, agency/state, five separate source date fields plus optional factUpdatedAt, exact API sourceUrl and observedAt. Supplier names/identifiers and personal contacts are excluded. Price lines are provided without calculated statistics or suggested bids. Free-text cells that begin with =, +, - or @ after leading whitespace gain a leading apostrophe for spreadsheet safety. spreadsheetEscapedColumns lists affected columns; DB users can remove exactly that added character from those columns. Text is already contact-minimized; original raw text is not retained.

The API has no per-row currency field: currency is null; currencyContext=BRL describes the official system's R$ convention. No FX conversion. A FR bottle with capacity5ML is not a one-ML price;0/null capacity stays0/null. Prices can represent registrations or procurement results rather than settled expenditure. Updates are not interpreted as order/payment dates. This covers material histories recorded in Compras.gov.br, not all Brazilian procurement or current bid availability. Official update frequency is not guaranteed.

### Pricing

$0.0015 per unique valid price line confirmed delivered (`price-line-delivered`). The Actor requests one charge per valid price line accepted for delivery; an interrupted or unacknowledged batch may leave rows and charges that need reconciliation. Missing codes and withheld rows are uncharged. Default at most200 rows costs$0.30; maximum500 costs$0.75. Each new run bills delivered snapshots again; no persistent cache. Spending caps can deliver a prefix. Null, nonfinite or nonpositive prices are withheld and counted without charge. All-zero eligible results fail NO_MATCHES without charged output.

### Limits

Normal HTTPS, no login/key/proxy;256MB;1second request pace;20attempts including robots/retries;150second acquisition deadline;15seconds/request;2MiB/body;8MiB aggregate decoded source bytes. The300second run allocates up to20seconds to startup,150seconds to source,100seconds to delivery,20seconds to final reports and10seconds to SDK exit. Source rows are fully staged and validated before charging. Runtime source/parse/byte/time failures produce no stored rows or price events. Planned item caps return explicit partial coverage. Source metadata and page counts must be consistent; any observed drift or conflicting duplicate identity fails staged acquisition rather than claiming complete.

Delivery uses at most10 batches of50, with batch-level progress rather than per-row report writes. Remaining time or spending limits stop before another batch and mark partial delivery. SDK writes and charging are not atomic: an acknowledgement or report failure can leave earlier rows delivered/charged. Do not blindly retry an ambiguous run. COVERAGE reports per-code source totals, withheld rows, caps, staged and confirmed-delivered counts; SUMMARY counts confirmed delivery, not attempted rows.

### Privacy

Supplier names and identifiers, CPF/CNPJ, contacts, private addresses and QSA are omitted. Public agency/city/state and material facts are retained. Obvious emails/phones/CPF are removed from permitted free text; this is contact minimization, not guaranteed anonymization. No raw bodies or live personal-name fixtures are stored. Official source/API and data-use notices apply; site-content licensing is not asserted to license all API data. Retain source attribution; no redistribution permission or endorsement is claimed. Raw research input does not certify procurement/legal compliance or comparable prices.

# Actor input Schema

## `catalogCodes` (type: `array`):

One to five known numeric material catalogue codes as strings. Deduplicated before requests; no description search or service codes.

## `lookbackDays` (type: `integer`):

Calendar days ending today in UTC-03:00; ignored when both exact dates are set. Filters source dataCompra, not source update/payment date.

## `dateFrom` (type: `string`):

Optional YYYY-MM-DD; supply both dates to override rolling days, up to1095inclusive days.

## `dateTo` (type: `string`):

Optional YYYY-MM-DD paired with dateFrom; source query bounds are inclusive in this product and each returned dataCompra is checked locally.

## `maxItemsPerCode` (type: `integer`):

1..100, default100; one page of100/code, five codes at most500 unique price lines. Source totals exceeding the selected cap are explicitly partial.

## Actor input object example

```json
{
  "catalogCodes": [
    "443435",
    "269520"
  ],
  "lookbackDays": 365,
  "dateFrom": "",
  "dateTo": "",
  "maxItemsPerCode": 100
}
```

# Actor output Schema

## `results` (type: `string`):

One historical price line per purchase item, with source units, package capacity, quantity and separate dates.

## `coverage` (type: `string`):

Source counts, withheld lines, limits and confirmed delivery for this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jpmarketdata/compras-gov-br-multi-catmat-price-export").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("jpmarketdata/compras-gov-br-multi-catmat-price-export").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call jpmarketdata/compras-gov-br-multi-catmat-price-export --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jpmarketdata/compras-gov-br-multi-catmat-price-export"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/DzUxmypBZiVodNmEQ/builds/IlHwluSY7Ap6BBRws/openapi.json
