# contractes.cat Independent open-data project about public procurement in Catalonia (not an official government site). What it answers that other sources don't combine: - Which companies win public contracts in Catalonia, from whom, how much, and how competitively (all contracts published on the Generalitat transparency portal since 2014). - Who controls those companies: owners (sole shareholders) and administrators from the Spanish companies register (BORME), linked to each company by NIF. - How much each person's companies won in public contracts *while that person owned or administered them*, and which companies are connected through shared owners or administrators (business groups). Use it to answer questions like "who are the administrators of and how many public contracts has it won?", "which companies does control and what contracts did they win?", or "which companies does award the most?". ## For AI agents HTML pages are protected against scrapers. Use the read-only JSON API or the CLI instead. The JSON API needs no key and accepts any HTTP client (curl, fetch, requests). Please keep it under ~5 requests/second; there is a per-IP limit of 300 requests/minute. All endpoints are GET, return `{"data": [...]}`, and paginate with `page=N` (1-based). Text search is accent- and case-insensitive. - Contracts: `https://www.contractes.cat/api/contractes?search=` - Filters: `year`, `nif` (awardee tax id), `awardee_name`, `nom_organ` (contracting body), `tipus_contracte`, `procediment`, `amountMin`, `amountMax`, `date_from`, `date_to` (YYYY-MM-DD) - `sort`: `date-desc` (default), `date-asc`, `amount-desc`, `amount-asc` - `format=csv` for CSV - Companies (awardees, ranked by awarded amount): `https://www.contractes.cat/api/empreses?search=` - `cpv=72,48` filters by CPV division; `format=csv` for CSV - Contracting bodies: `https://www.contractes.cat/api/organismes?search=&limit=N` - Top companies for a body: `https://www.contractes.cat/api/organismes/top-empreses?organ=&limit=N` - People (company owners and administrators from BORME): `https://www.contractes.cat/api/persones?search=` - Contracts linked to a person: `https://www.contractes.cat/api/persones//contractes` (optional `date_from`, `date_to`, `nom_organ`, `sort`) Human-readable pages to cite for users: - Company: `https://www.contractes.cat/empreses/` - Contracting body: `https://www.contractes.cat/organismes/` - Person: `https://www.contractes.cat/persones/` ## MCP server - Remote MCP endpoint (Streamable HTTP, no auth): `https://www.contractes.cat/api/mcp` - Tools: search_companies, get_company, search_people, get_person, search_contracts, search_public_bodies, get_public_body_top_companies - ChatGPT plugin (one click): https://chatgpt.com/plugins/plugin_asdk_app_6af201c53e148191a9b6fa95f1c37a31 - Claude connector (one click): https://claude.ai/directory/contractes-cat - Setup for Claude, ChatGPT, Codex, Cursor and VS Code: https://www.contractes.cat/assistents ## CLI - Package: `@gerardgimenezadsuar/contractes-cli` - Binary: `contractes` - Install: `npm install -g @gerardgimenezadsuar/contractes-cli` - Quick help: `contractes help` ## Main CLI commands - `contractes search-contracts --search "" [--year YYYY] [--nif ] [--page N]` - `contractes search-companies --search "" [--cpv 72,48] [--page N]` - `contractes search-organs --search "" [--limit N] [--page N]` - `contractes organ-top-companies --organ "" [--limit N]` - `contractes person-contracts --name "" [--date-from YYYY-MM-DD] [--date-to YYYY-MM-DD]` - `contractes attribution` ## API base URL - Production: `https://www.contractes.cat` - Override for CLI: `CONTRACTES_API_BASE=` ## Attribution Dataset shown by contractes.cat comes from: - Dataset id: `ybgg-dgi6` - Publisher: `Departament d'Economia i Hisenda` - Source portal: `https://analisi.transparenciacatalunya.cat` - License/terms: `https://administraciodigital.gencat.cat/ca/dades/dades-obertes/informacio-practica/llicencies/`