API documentation
Check every new customer automatically.
Score any UK company from your own systems: search, the verdict as one object, or the whole report. The API is included in the Enterprise plan.
Basics
Base URL
https://trustfox.co.uk/api/v1Authentication
Create a key on your account page and send it as a bearer token on every request. It is shown once, when you create it, so keep it somewhere safe. You can replace it at any time, and the old key stops working straight away. Keys start with tf_live_. Keep them server-side; never put one in a browser or a mobile app.
Authorization: Bearer tf_live_…Checks and limits
- Each company scored, through the score or report endpoint, uses one of the monthly checks on your plan the first time that calendar month. Scoring it again that month is free. Search uses no checks.
- Requests are limited to 60 an hour per calling IP address. Every response carries X-RateLimit-Limit and X-RateLimit-Remaining; a 429 carries Retry-After.
- Reports are cached for 24 hours. Add fresh=1 to re-read the company’s own records from Companies House. A fresh check takes 5 to 15 seconds; a cached one is immediate.
- Company numbers are eight characters: digits are padded with zeros to make eight; Scottish and Northern Irish numbers keep their two-letter prefix.
Versioning and data
The version is in the path. Fields may be added without notice; nothing is removed or renamed without a new version. Responses contain public sector information licensed under the Open Government Licence v3.0 and are for trade credit decisions only. A view on trade credit, from public records. Not a credit rating, not a credit reference on any individual, and not investment, financial or legal advice.
Search
GET https://trustfox.co.uk/api/v1/companies/search?q=sample+constructionPass a registered name or a company number of two or more characters. The best 20 matches are returned; total is the full match count on the register. This response shows the fictional example company.
{
"query": "sample construction",
"total": 1,
"items": [
{
"companyNumber": "EX000001",
"name": "SAMPLE CONSTRUCTION LIMITED",
"status": "active",
"statusLabel": "Active",
"type": "ltd",
"typeLabel": "Private limited company",
"incorporatedOn": "2014-03-12",
"address": "Unit 4, Example Business Park, Leeds, LS99 9EX"
}
]
}Score
GET https://trustfox.co.uk/api/v1/companies/{number}/score?fresh=1The verdict in one object: score, band, stance, indicative limit and every signal that fired. This response is for the fictional example company; a real company number returns the same shape.
{
"companyNumber": "EX000001",
"companyName": "SAMPLE CONSTRUCTION LIMITED",
"status": "active",
"statusLabel": "Active",
"incorporatedOn": "2014-03-12",
"score": 15,
"band": "E",
"riskLabel": "Very high risk",
"riskLevel": "High",
"stance": "On this record, credit is not recommended.",
"confidence": "high",
"indicativeCreditLimit": 0,
"signals": [
{
"id": "financials-negative-net-assets",
"category": "financials",
"severity": "high",
"points": -25,
"title": "Negative net assets of -£78,300"
},
{
"id": "financials-liquidity-weak",
"category": "financials",
"severity": "high",
"points": -15,
"title": "Weak liquidity (current ratio 0.46)"
},
{
"id": "financials-insolvent-and-illiquid",
"category": "financials",
"severity": "high",
"points": -10,
"title": "Balance-sheet insolvent with no liquidity cushion"
},
{
"id": "directors-idv-missing",
"category": "transparency",
"severity": "medium",
"points": -8,
"title": "No director has verified their identity"
},
{
"id": "filings-late-accounts",
"category": "filings",
"severity": "medium",
"points": -6,
"title": "Accounts filed late 1 time in the last five years"
},
{
"id": "financials-loss-making",
"category": "financials",
"severity": "medium",
"points": -6,
"title": "Loss of £34,900 in the latest period"
},
{
"id": "sector-high-risk",
"category": "sector",
"severity": "low",
"points": -5,
"title": "Higher-risk sector: Other building completion and finishing"
},
{
"id": "financials-low-cash",
"category": "financials",
"severity": "low",
"points": -4,
"title": "Low cash relative to short-term creditors"
},
{
"id": "directors-single",
"category": "directors",
"severity": "low",
"points": -4,
"title": "Single director, no other officers"
},
{
"id": "directors-insolvent-minor-SAMPLE, Alex",
"category": "directors",
"severity": "low",
"points": -4,
"title": "Alex Sample has 1 previous company that went through insolvency, among 2 appointments"
},
{
"id": "charges-new-borrowing",
"category": "charges",
"severity": "low",
"points": -4,
"title": "1 new charge registered in the last 12 months"
},
{
"id": "charges-outstanding",
"category": "charges",
"severity": "low",
"points": -3,
"title": "1 outstanding secured charge"
},
{
"id": "age-10-plus",
"category": "age",
"severity": "positive",
"points": 4,
"title": "Established for 12 years"
},
{
"id": "directors-stable",
"category": "directors",
"severity": "positive",
"points": 3,
"title": "Stable leadership (longest-serving director 12 years)"
},
{
"id": "ownership-owner-managed",
"category": "ownership",
"severity": "positive",
"points": 2,
"title": "Owner-managed"
},
{
"id": "status-active",
"category": "status",
"severity": "info",
"points": 0,
"title": "Active on the Companies House register"
}
],
"generatedAt": "2026-11-23T15:04:55.960Z",
"reportId": "<report id>",
"reportUrl": "https://trustfox.co.uk/report/<report id>",
"notice": "A view on trade credit, from public records. Not a credit rating, not a credit reference on any individual, and not investment, financial or legal advice."
}| Field | Type | Meaning |
|---|---|---|
| companyNumber | string | Eight-character number as held by Companies House. |
| companyName | string | Current registered name. |
| status / statusLabel | string | Companies House status (active, dissolved, liquidation…) and its label. |
| incorporatedOn | date | ISO date of incorporation. |
| score | integer | 0 to 100. Every company starts at 100; rules deduct, positives add back at most 10. |
| band | A–E | A 80+, B 65+, C 50+, D 30+, E below 30. |
| riskLabel | string | Low risk, Moderate risk, Elevated risk, High risk or Very high risk. |
| riskLevel | Low | Medium | High | Three-level summary for simple integrations. |
| stance | string | One-line credit stance, e.g. “Avoid open credit; take a deposit or pro-forma payment.” |
| confidence | high | medium | low | How much of the record could be read: complete, partial or thin. It describes the evidence, not the company. A score of 20 with high confidence means the bad picture is well evidenced. |
| indicativeCreditLimit | integer | null | Whole pounds. 0 means the rules support no credit. null when it cannot be computed: no machine-readable accounts, or the company is not active. |
| signals | array | Every rule that fired: id, category, severity (critical, high, medium, low, info, positive), points (negative deducts) and title. The full report adds detail and evidence to each. |
| generatedAt | date-time | When the report was generated. Reports are cached for 24 hours. |
| reportId / reportUrl | string | Identifier and shareable link for the full report. reportId is null when no database is configured. |
| notice | string | What the response is and is not: a view on trade credit, not a credit rating or advice. Show it wherever you show the score. |
Full report
GET https://trustfox.co.uk/api/v1/companies/{number}?fresh=1&narrative=1Everything on the report page as one object under report. Add narrative=1 to include the AI analyst commentary; it can add up to a minute and is null when the commentary is unavailable. The sections:
| Field | Type | Meaning |
|---|---|---|
| company | object | Status, type, incorporation and cessation dates, SIC codes, registered office and its flags, previous names, accounts and confirmation statement due dates with overdue flags, charge and insolvency flags. |
| score | object | As the score endpoint, plus confidenceReasons and, on each signal, detail and evidence. |
| directors | object | active and resigned officers (resigned in the last five years, up to 20), each with role, dates, month and year of birth, nationality, identity verification status, an appointments summary across their other companies (total, dissolved, failed, failure rate, up to 100 appointments listed) and the disqualified-register result. |
| ownership | object | Persons with significant control (pscs), ceased PSCs and PSC statements, with natures of control. |
| financials | object | null | The latest machine-readable accounts: source filing, current and prior period figures (fixed and current assets, cash, debtors, stocks, creditors within and after one year, net current assets, net assets, equity, turnover, profit, employees where tagged) and ratios (current, cash, net assets change, gearing). null when the latest accounts were filed as a scanned document. |
| filings | object | Filing count and status, the latest 60 filings, late accounts and late confirmation statements with days late, gazette notices, strike-off notices in the last three years, registered office changes and director churn in 24 months, last accounts and confirmation statement dates. |
| charges | object | Counts of outstanding, satisfied and part-satisfied charges, charges created in the last 12 months, lenders under outstanding charges and the 12 most recent charges. |
| insolvency | object | null | Formal insolvency cases with type, dated events and practitioners. null when none are recorded. |
| narrative | object | null | AI analyst commentary (headline, summary, strengths, concerns, suggested terms, questions to ask) when narrative=1 was requested and the AI is available. It explains the score and never changes it. |
| meta | object | apiRequests, warnings, durationMs and asAt (only on dated snapshots). |
Every field, with types, is in the OpenAPI 3.1 document.
Errors
Every error is JSON with a stable code to branch on and a message you can show:
{ "error": { "code": "allowance_used", "message": "Monthly allowance used (100 of 100)." } }| Field | Type | Meaning |
|---|---|---|
| 400 | invalid_company_number · invalid_query | Malformed company number, or a search of fewer than two characters. |
| 401 | unauthorised | Missing or unknown API key. |
| 402 | allowance_used | The plan’s monthly checks are used up. The message gives the numbers. |
| 403 | plan_required | The key’s plan does not include the API, the account has no plan and its free period is over, or the key’s login is paused because its team has more logins than its plan allows. |
| 404 | company_not_found | No company with that number. |
| 429 | rate_limited | More than 60 requests in an hour from one IP address. Retry-After header and retryAfterSeconds in the body. |
| 500 | internal_error | The report could not be generated. Safe to retry. |
| 502 | upstream_error | Companies House returned an error. Retry shortly. |
| 503 | upstream_rate_limited | The company register is at its request limit. Retry-After header and retryAfterSeconds in the body. |
Examples
curl
curl -H "Authorization: Bearer $TRUSTFOX_KEY" \
"https://trustfox.co.uk/api/v1/companies/{number}/score"Node
const res = await fetch("https://trustfox.co.uk/api/v1/companies/{number}/score", {
headers: { Authorization: `Bearer ${process.env.TRUSTFOX_KEY}` },
})
if (!res.ok) {
const { error } = await res.json()
throw new Error(`TrustFox ${res.status} ${error.code}: ${error.message}`)
}
const { score, band, stance, indicativeCreditLimit } = await res.json()Python
import os, requests
r = requests.get(
"https://trustfox.co.uk/api/v1/companies/{number}/score",
headers={"Authorization": f"Bearer {os.environ['TRUSTFOX_KEY']}"},
timeout=30,
)
r.raise_for_status()
verdict = r.json()
print(verdict["band"], verdict["stance"])Suggested use in onboarding
Call the score endpoint the moment a new customer gives you their company number. Bands A and B can open on standard terms, C on a set credit limit, D and E on pro-forma or a deposit. Store reportUrl against the account so the decision can be defended later, and re-check before raising a limit.
