# Paraguay DNCP Public Procurement (OCDS) (`downright_blessing/paraguay-dncp-ocds`) Actor

Search Paraguay DNCP public procurement processes via the official Datos API v3 and return structured OCDS notice/contract rows (ocid, title, buyer, dates, value, status, source URL). Optional detail fetch of compiled releases.

- **URL**: https://apify.com/downright\_blessing/paraguay-dncp-ocds.md
- **Developed by:** [Joao Pedro Rosado](https://apify.com/downright_blessing) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 procurement notices

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

## Paraguay DNCP Public Procurement (OCDS)

Search **Paraguay DNCP** (Dirección Nacional de Contrataciones Públicas) public procurement processes via the official **Datos API v3** and return structured **OCDS** notice/contract rows: `ocid`, title, buyer, dates, value, status and source URL.

No API key for search/record. Official public open data (CC BY 4.0).

**Docs:** [DNCP Datos API v3](https://contrataciones.gov.py/datos/api/v3/doc/)\
**Endpoints used:**

- `GET …/datos/api/v3/doc/search/processes` (filters: keyword / ocid / date range)
- `GET …/datos/api/v3/doc/ocds/record/{ocid}` (compiled release detail)

***

### What it does

1. Builds a filtered search against DNCP `search/processes` (requires at least one filter — keyword, ocid, or date range).
2. Optionally fetches each hit’s **compiled OCDS release** for buyer, value, status and periods.
3. Writes one Dataset row per process (`ocid`).

Scope is intentionally focused (search + detail) — **not** a full DNCP mirror.

### Who it's for

- LatAm bid desks and BR→PY procurement consultants
- Infrastructure / public-works data rooms
- Compliance and supplier-intel agents that already use PNCP-style Actors
- ETL jobs that need **official OCDS JSON**, not scraped HTML

### Input summary

| Field | Required | Description |
|---|---|---|
| `keyword` | no\* | Exact-term filter on `tender.title` |
| `ocid` | no\* | OCDS ocid, e.g. `ocds-03ad3f-365292-1` |
| `dateFrom` / `dateTo` | no\* | `YYYY-MM-DD` range with `dateType` |
| `dateType` | no | `fecha_release` (default), `publicacion_llamado`, `entrega_ofertas`, `adjudicacion`, `firma_contrato` |
| `fetchDetails` | no | Enrich via `/ocds/record/{ocid}` (default true) |
| `maxItems` | no | Hard Dataset cap (default 20, max 500) |
| `requestDelayMs` | no | Delay between detail calls (default 200) |

\*Provide at least one of keyword, ocid, or a date range. Local default uses `keyword=servicio`.

### Output fields

One Dataset row per process:

`ocid`, `title`, `buyerName`, `buyerId`, `procuringEntityName`, `status`, `statusDetails`, `procurementMethod`, `procurementMethodDetails`, `mainProcurementCategory`, `valueAmount`, `valueCurrency`, `datePublished`, `tenderPeriodStart`, `tenderPeriodEnd`, `releaseDate`, `releaseTags`, `tenderId`, `awardCount`, `contractCount`, `sourceUrl`, `sourceApi`, `detailApi`, `scrapedAt`.

### Pricing

**Pay-per-event** suggested for the Store:

- **Actor start** (`apify-actor-start`): about **$0.04** / run
- **Dataset item** (`apify-default-dataset-item`): about **$0.02** / notice

Use `maxItems` as the spend cap. See Store pricing panel once published.

### Quick start (Apify Console)

1. Open the Actor → **Start**.
2. Set `keyword` and/or date range / `ocid`.
3. Tune `maxItems` / `fetchDetails`.
4. Run → export Dataset JSON/CSV.

```json
{
  "keyword": "servicio",
  "dateFrom": "",
  "dateTo": "",
  "dateType": "fecha_release",
  "fetchDetails": true,
  "maxItems": 20,
  "requestDelayMs": 200
}
```

#### Local smoke

```bash
npm run local
## or: APIFY_LOCAL=1 node src/main.js
```

Writes `storage/datasets/default/000000001.json` and `storage/key_value_stores/default/OUTPUT.json`.

### Legal / data source

Data comes from the official **DNCP Paraguay Datos API v3** (`contrataciones.gov.py`). Publisher license: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Publication policy: [DNCP datos legal](https://www.contrataciones.gov.py/datos/legal). This Actor is an independent tool — **not affiliated** with DNCP. Results are point-in-time open data, **not** legal advice. Use a polite User-Agent and respect fair-use rates.

***

### Português (resumo)

Consulta licitações/contratos públicos do **Paraguay (DNCP)** pela API oficial Datos v3 em **OCDS** JSON. Devolve `ocid`, título, comprador, datas, valor, status e URL. Sem API key. Ideal para desks LatAm e extensão do PNCP. **Pay-per-event** sugerido: ~US$0,04 por execução + ~US$0,02 por aviso. Fonte legal = DNCP oficial.

# Actor input Schema

## `keyword` (type: `string`):

Exact-term search against tender.title on DNCP search/processes. Example: servicio, software, construcción.

## `ocid` (type: `string`):

Optional OCDS ocid (e.g. ocds-03ad3f-365292-1). When set, search filters by ocid and/or fetches that record detail.

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

Start of date range. Used with dateTo and dateType. Leave empty to skip date filter.

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

End of date range (inclusive). Used with dateFrom and dateType.

## `dateType` (type: `string`):

DNCP tipo\_fecha for the date range filter.

## `fetchDetails` (type: `boolean`):

If true, call GET /ocds/record/{ocid} for each search hit to enrich buyer/value/status fields.

## `maxItems` (type: `integer`):

Hard Dataset row cap (one row per process/ocid).

## `requestDelayMs` (type: `integer`):

Polite throttle between ocds/record fetches. Default 200.

## Actor input object example

```json
{
  "keyword": "servicio",
  "ocid": "",
  "dateFrom": "",
  "dateTo": "",
  "dateType": "fecha_release",
  "fetchDetails": true,
  "maxItems": 20,
  "requestDelayMs": 200
}
```

# Actor output Schema

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

Default dataset items: ocid, title, buyer, dates, value, status, source URL.

# 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 = {
    "keyword": "servicio"
};

// Run the Actor and wait for it to finish
const run = await client.actor("downright_blessing/paraguay-dncp-ocds").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 = { "keyword": "servicio" }

# Run the Actor and wait for it to finish
run = client.actor("downright_blessing/paraguay-dncp-ocds").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 '{
  "keyword": "servicio"
}' |
apify call downright_blessing/paraguay-dncp-ocds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,downright_blessing/paraguay-dncp-ocds"
        }
    }
}
```

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/MpasOUy4MJl8mqPIp/builds/7JNgruEHRXLrBgS7t/openapi.json
