Skip to main content
Use the Nesu API to search Portuguese companies, retrieve company details by tax identification number (NIF), and monitor your account usage. Your API base URL is https://api.nesu.pt/v1. Successful requests return JSON; API handler errors return problem details.
If you used an earlier example with /api/v1, update your base URL to /v1. The old paths return 404; they do not redirect to the new endpoints.

Prerequisites

  • A Nesu account and an active API key. In your Nesu dashboard, open API keys (/dashboard/api-keys in the Nesu application), create a key, and save the full secret when it appears. See Authentication.
  • A terminal with Bash and cURL installed.

1. Check your connection

Set your API key in your terminal, then request your usage. Replace the placeholder with your full key, including its nesu_ prefix.
A successful request returns success: true and a data object containing your plan, credit balance, quotas, and rate-limit capacity. This request uses rate-limit capacity but does not consume a credit.

2. Search for a company

Pass a company name in q. Use --data-urlencode to handle spaces and accented characters.
You receive up to 20 matches in data. An empty array means your query has no directory matches. You can also search using a NIF. See Search companies.

3. Retrieve company details

Use a NIF from your search results as the path parameter. The example below uses 509442013; replace it with the company you need.
A successful lookup returns result: "success" and a data object with the company’s name, address, activity, legal structure, available debt brackets, and freshness fields. Check data.updated_at for the stored record’s timestamp and data.stale to detect stale-cache fallback. See Get a company.
Each admitted search or company lookup consumes one credit, even if it later returns a validation error, no matches, or a lookup error. Check your input before sending requests. See Limits and credits.

Integrate into your application

  • Send requests from your server so your API key stays private.
  • Read each endpoint’s response contract: search, lookup, and usage use different success envelopes.
  • Decide whether your application can accept a company response with stale: true during an upstream outage.
  • Inspect the HTTP status and problem type when a request fails. For 429, honor Retry-After; distinguish a temporary rate limit from an exhausted credit quota.
  • Handle 504 timeout problems with a bounded retry policy. Search has a five-second service deadline; company lookup has a 30-second service deadline. Authentication and network time are additional, so set your client’s timeout accordingly.
  • When processing multiple companies, pace requests using the rate-limit headers and monitor account usage.
The response examples in these docs use illustrative fixture data. Your company records, quotas, balances, and dates will differ.