# ChileCompra Award & Tender Intelligence (official OCDS) (`bahc19/chilecompra-award-tender-intel`) Actor

Turn official ChileCompra open-data records into normalized tender and award intelligence: winning suppliers, buyer/supplier history, category analytics, market concentration. Evidence-backed, descriptive statistics only.

- **URL**: https://apify.com/bahc19/chilecompra-award-tender-intel.md
- **Developed by:** [Benjamin](https://apify.com/bahc19) (community)
- **Categories:** Automation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 enriched tender/award records

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Procurement Intelligence Core (procintel)

Shared normalization / award-intelligence core for the micro-product portfolio.

### Sources (official, in priority order)

| Source | Access | Status |
|---|---|---|
| KONEPS bid notices (`BidPublicInfoService`, 25 ops) | data.go.kr service key | endpoints verified 2026-08-09; key requires Korean identity verification (human gate) |
| KONEPS successful bids (`ScsbidInfoService`, 23 ops) | data.go.kr service key | endpoints verified 2026-08-09; key gated as above |
| ChileCompra OCDS (Datos Abiertos) | public, no auth | LIVE — used for v0.1 |
| TED Search API | public, no auth | not yet wired |
| World Bank Procurement Notice | public, CC BY 4.0 | not yet wired |

### Setup

```bash
python -m venv .venv && . .venv/bin/activate
pip install -e .
pytest
```

### CLI

```bash
## collect bounded real records for one month (raw snapshots stored with SHA-256)
procintel collect 2026 7 --max-records 25 --modes tender,direct --raw-dir data/raw/chile --out data/collected_2026_07.jsonl

## normalize to canonical Tender records (evidence-backed)
procintel normalize data/collected_2026_07.jsonl --out data/normalized/tenders_2026_07.jsonl

## descriptive award intelligence (observed history only)
procintel award-intel --normalized data/normalized/tenders_2026_07.jsonl --market --limit 10
procintel award-intel --normalized data/normalized/tenders_2026_07.jsonl --vendor "VERAELEC"
procintel award-intel --normalized data/normalized/tenders_2026_07.jsonl --buyer "CORP MUNIC"
procintel award-intel --normalized data/normalized/tenders_2026_07.jsonl --recent-days 30

## deterministic field diff (for change intelligence)
procintel diff old.json new.json
```

### KONEPS adapter (ready, key-gated)

- Verified live operations: `research/KONEPS_VERIFIED_OPERATIONS_2026-08-09.json`
- Full swagger specs: `research/koneps_{bid,award}_swagger_2026-08-09.json`
- Collector scaffold: `src/procintel/collectors/koneps.py` (needs `KONEPS_SERVICE_KEY`)
- The successful-bid service includes final winner, ranking, preliminary prices,
  rebid/failed lists; the bid service includes base amounts, license restrictions,
  eligible regions and change history — join is exact via `bidNtceNo`/`bidNtceOrd`.

### Compliance

- Raw snapshots are stored verbatim with SHA-256 + retrieved\_at + source URL.
- Every derived record carries `evidence` (source, record\_id, url, field).
- Analytics are descriptive only; outputs include an explicit disclaimer.
- No fabricated data: synthetic fixtures must be labeled `"synthetic": true`.
- Never bypass CAPTCHA/auth/rate limits; official API/open-data first.

# Actor input Schema

## `mode` (type: `string`):

records: collect normalized tender+award records for a date range. buyer/vendor/category: descriptive history analytics. market: concentration overview.

## `year` (type: `integer`):

Collection year for records mode. Official data is available from 2009.

## `month` (type: `integer`):

Collection month.

## `max_records` (type: `integer`):

Bounded number of tender records to collect (polite access; detail calls are rate-limited).

## `modes` (type: `array`):

tender: public licitaciones; direct: trato directo; framework: convenio marco.

## `query` (type: `string`):

Name, RUT, CL-MP id, or UNSPSC code to analyze (e.g. CORP MUNIC, VERAELEC, 47121602). Required for buyer/vendor/category modes.

## `max_entries` (type: `integer`):

Number of top entries to include in analytics output.

## `include_raw_evidence` (type: `boolean`):

Attach evidence (source, ocid, URL) to every output record. Always on for records mode.

## Actor input object example

```json
{
  "mode": "records",
  "max_records": 100,
  "modes": [
    "tender",
    "direct"
  ],
  "max_entries": 10,
  "include_raw_evidence": true
}
```

# 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("bahc19/chilecompra-award-tender-intel").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("bahc19/chilecompra-award-tender-intel").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 bahc19/chilecompra-award-tender-intel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bahc19/chilecompra-award-tender-intel"
        }
    }
}

```

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/lTS8gn1Ehx8qfDSUO/builds/XqKwy2CuVeobO9YvL/openapi.json
