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-keysin 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 itsnesu_ prefix.
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 inq. Use --data-urlencode to handle spaces and accented characters.
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 uses509442013; replace it with the company you need.
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: trueduring an upstream outage. - Inspect the HTTP status and problem
typewhen a request fails. For429, honorRetry-After; distinguish a temporary rate limit from an exhausted credit quota. - Handle
504timeout 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.
