OC Intelligence API
Programmatic access to UK government contract data, buyer intelligence, supplier profiles and renewal opportunities. All endpoints return JSON. Base URL: https://intelligence-proxy.damian-hastie.workers.dev
Authentication
All API requests require an API key passed in the X-API-Key header. Generate your key from the Account page.
Keys look like oci_ followed by 64 hex characters. Keep your key secret — never expose it in client-side code.
Rate Limits
Limits are per API key per calendar day, resetting at midnight UTC. Your remaining requests are returned in every response under meta.requests_remaining.
When you exceed your limit the API returns HTTP 429 with a JSON error body.
Response Format
All responses are JSON with a consistent envelope:
Endpoints
Search across Contracts Finder (400k+) and PCS Scotland (25k+). Returns awarded contracts matching your query.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | optional | Keyword search across title, buyer and supplier |
| source | string | optional | cf, pcs, or cf,pcs (default: both) |
| date_from | date | optional | Published date from (YYYY-MM-DD) |
| date_to | date | optional | Published date to (YYYY-MM-DD) |
| cpv | string | optional | CPV code prefix e.g. 72 for IT Services |
| min_value | number | optional | Minimum contract value in GBP |
| limit | integer | optional | Results per page (default 50, max 200) |
| offset | integer | optional | Pagination offset (default 0) |
Returns a buyer profile with spending statistics and recent awarded contracts. URL-encode the buyer name.
Response fields
| Field | Description |
|---|---|
| profile.total_spend | Total awarded contract value (GBP) |
| profile.contract_count | Total number of awarded contracts |
| profile.top_suppliers | Most frequently awarded suppliers |
| recent_contracts | Up to 20 most recent awards |
Returns a supplier profile with contract history, win rates and buyer relationships. URL-encode the supplier name.
Returns contracts estimated or confirmed to be expiring within the specified window. Ideal for identifying re-tender opportunities programmatically.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| window_months | integer | optional | Look-ahead window in months (default 12, max 36) |
| source | string | optional | cf, pcs, or both (default) |
| cpv | string | optional | CPV code prefix |
| min_value | number | optional | Minimum contract value in GBP |
| limit | integer | optional | Results (default 50, max 200) |
Urgency values
Results include an urgency field: critical (≤90 days), soon (≤180 days), upcoming (≤365 days), pipeline (>365 days).
Error Codes
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 404 | Unknown endpoint |
| 429 | Rate limit exceeded — resets midnight UTC |
| 500 | Internal server error |
Quick Start (JavaScript)
Ready to get started? Generate your API key →