curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $NESU_API_KEY" \
'https://api.nesu.pt/v1/companies/509442013'
{
"result": "success",
"data": {
"nif": 509442013,
"title": "Exemplo, Lda",
"address": "Rua de Exemplo, 1",
"zipcode": "1000-001",
"city": "Lisboa",
"activity": "Atividade de exemplo",
"status": "",
"cae": "",
"structure": {
"nature": "Sociedade por quotas",
"capital": "5000.00",
"capital_currency": "EUR"
},
"tax_debt": {
"start": 10000,
"end": 50000,
"last_updated": "2026-09-15"
},
"social_security_debt": null,
"updated_at": "2026-09-15T12:00:00Z",
"stale": false
}
}
API reference
Get a company
Retrieve a Portuguese company’s address, activity, legal structure, and available debt brackets by NIF.
GET
/
v1
/
companies
/
{nif}
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $NESU_API_KEY" \
'https://api.nesu.pt/v1/companies/509442013'
{
"result": "success",
"data": {
"nif": 509442013,
"title": "Exemplo, Lda",
"address": "Rua de Exemplo, 1",
"zipcode": "1000-001",
"city": "Lisboa",
"activity": "Atividade de exemplo",
"status": "",
"cae": "",
"structure": {
"nature": "Sociedade por quotas",
"capital": "5000.00",
"capital_currency": "EUR"
},
"tax_debt": {
"start": 10000,
"end": 50000,
"last_updated": "2026-09-15"
},
"social_security_debt": null,
"updated_at": "2026-09-15T12:00:00Z",
"stale": false
}
}
Prerequisites
You need an active API key, a NIF with a valid checksum, available rate-limit capacity, and one credit from your included allowance or purchased balance. Retrieve company details using a Portuguese tax identification number. Each admitted request consumes one credit, including a cached lookup.Path parameter
A nine-digit Portuguese tax identification number with a valid checksum. Spaces, hyphens, and periods are accepted as separators; URL-encode spaces if you include them. Prefer an unformatted nine-digit value.
Response
You receive200 OK with this envelope:
Company fields
| Field | Type | Meaning |
|---|---|---|
nif | integer | The company’s NIF. Unlike search results, this is a JSON number. |
title | string | The company’s legal name. |
address | string | The company’s address. |
zipcode | string | Postal code. |
city | string | City or locality. |
activity | string | Activity description. |
status | string | Company status supplied by the data provider. Treat this as text rather than a fixed enum. |
cae | string | Primary economic activity classification (CAE) code. |
structure | object | Legal nature and share capital. |
tax_debt | object or null | Available tax-authority debt bracket. |
social_security_debt | object or null | Available social-security debt bracket. |
updated_at | string | Timestamp when the stored company record was last written or refreshed, in RFC 3339 format with optional fractional seconds. This is not the provider’s own update time. |
stale | boolean | true when both upstream providers failed and you received an older cached company record; otherwise false. |
Legal structure
| Field | Type | Meaning |
|---|---|---|
structure.nature | string | The company’s legal nature. |
structure.capital | string | Share capital as a decimal string, not a JSON number. Preserve decimal precision when processing it. |
structure.capital_currency | string | Currency associated with the capital value. |
"0" and "EUR" respectively. Do not interpret those defaults as independently verified financial figures.
Debt brackets
Whentax_debt or social_security_debt is an object, it has these fields:
| Field | Type | Meaning |
|---|---|---|
start | integer | Lower amount of the published debt bracket. |
end | integer or null | Upper amount; null indicates an open-ended bracket. |
last_updated | string | The source dataset’s update date in YYYY-MM-DD format. |
null debt object means no bracket is available in the imported dataset; it is not confirmation of zero debt. Check last_updated when using a bracket.
Data freshness
You receive stored company details when the record is less than six days old. For a missing or older record, the API attempts a refresh through NIF.PT, then falls back to the commercial registry if NIF.PT fails. If both upstream providers fail and an older cached company record is available, you receive200 OK with stale: true. Its updated_at timestamp remains unchanged. There is no maximum age enforced for this fallback, so use the timestamp to decide whether the record is suitable for your application. Fresh-cache and successful-refresh responses have stale: false.
Without a cached record, an upstream failure returns an error. Local database read or write failures can also return an error; stale fallback applies to upstream-fetch failures, not every lookup failure.
Your company lookup has a 30-second service deadline. If the deadline is exceeded and stale fallback cannot return a record, you receive 504 company-lookup-timeout.
Debt datasets are imported separately, so their source dates can differ from updated_at. Check each bracket’s last_updated independently.
Errors
400 validation: your NIF cannot be normalized to nine digits or fails the checksum.404 company-not-found: no company was found for your valid NIF.502 company-lookup-failed: the lookup or refresh could not complete.504 company-lookup-timeout: the lookup exceeded its service deadline and could not return a fallback record.
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $NESU_API_KEY" \
'https://api.nesu.pt/v1/companies/509442013'
Illustrative fixture response; this is not a live company record or debt report.{
"result": "success",
"data": {
"nif": 509442013,
"title": "Exemplo, Lda",
"address": "Rua de Exemplo, 1",
"zipcode": "1000-001",
"city": "Lisboa",
"activity": "Atividade de exemplo",
"status": "",
"cae": "",
"structure": {
"nature": "Sociedade por quotas",
"capital": "5000.00",
"capital_currency": "EUR"
},
"tax_debt": {
"start": 10000,
"end": 50000,
"last_updated": "2026-09-15"
},
"social_security_debt": null,
"updated_at": "2026-09-15T12:00:00Z",
"stale": false
}
}
Was this page helpful?
