GET /v1/fetch-document
fetch-document
A document from the register as a file.
Costs and limits
Every delivered document costs the same, whatever its type. If a document cannot be delivered, the request costs nothing.
| What | Credits |
|---|---|
| One delivered document | 15 |
Limit: 5 requests per minute. Search, documents and Signals share a quota of 60 requests per minute.
Request
Our example request fetches the Aktueller Abdruck (current printout) of Hetzner Online GmbH, Ansbach HRB 6089. You get the company's entity_id from the company profile or from Search & Export.
curl -G "https://handelsregister.ai/api/v1/fetch-document" \ -H "x-api-key: YOUR_API_KEY" \ --data-urlencode 'company_id=94eb910fef13f94585c48c263fa446d4' \ --data-urlencode 'document_type=AD'
import requests response = requests.get( "https://handelsregister.ai/api/v1/fetch-document", headers={"x-api-key": "YOUR_API_KEY"}, params={ "company_id": "94eb910fef13f94585c48c263fa446d4", "document_type": "AD", }, ) data = response.json()
const url = new URL("https://handelsregister.ai/api/v1/fetch-document"); url.searchParams.append("company_id", "94eb910fef13f94585c48c263fa446d4"); url.searchParams.append("document_type", "AD"); const response = await fetch(url, { headers: { "x-api-key": "YOUR_API_KEY" }, }); const data = await response.json();
The response is the file itself. Save it instead of reading it as JSON, for example with curl -o or response.content in Python.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| company_idQuery | stringrequired |
The company's entity_id, 32 characters from digits and the letters a to f. |
94eb910fef13f94585c48c263fa446d4 |
| document_typeQuery | stringrequired |
The document type, see the table below. Upper and lower case matter.Values: AD, CD, shareholders_list, articles_of_association, SI |
AD |
| asyncQuery | booleanoptional |
With true your request does not wait until the register delivers. See Good to know.Default: false |
true |
| Idempotency-KeyHeader | stringoptional | A value of your own per request. If you repeat the same request with the same key, it is charged only once. More under Limits.Limits: 1 to 128 characters | – |
Document types
The documents come from the Handelsregister (commercial register) and carry these names there.
| document_type | Document | Available for | Format |
|---|---|---|---|
| AD | Aktueller Abdruck (current printout)All entries that apply today. | Every registered company | |
| CD | Chronologischer Abdruck (chronological printout)All entries in chronological order, including the outdated ones. | Every registered company | |
| SI | Strukturierter Registerinhalt (structured register content)The register content as XML in the XJustiz format, for processing by machine. | Every registered company | XML |
| shareholders_list | Gesellschafterliste (shareholder list)The shareholders with their shares according to § 40 GmbHG. | GmbH and UG | |
| articles_of_association | Gesellschaftsvertrag or Satzung (articles of association)The articles of association, for a GmbH the Gesellschaftsvertrag, for a cooperative the Statut. | Corporations and cooperatives |
The Strukturierter Registerinhalt comes as XML, all other documents as PDF. Some documents, among them shareholder lists, can be scans without a text layer.
Response
On success the response is the file with status 200. Cost and format are in the headers, not in a JSON body.
| Header | Example | Meaning |
|---|---|---|
| content-type |
application/pdf |
application/pdf or application/xml; charset=utf-8.
|
| content-disposition |
inline; filename="document_94eb910fef13f94585c48c263fa446d4_AD_2026-11-01.pdf" |
The file name with entity_id, document type and the day the document came from the register.
|
| x-credits-charged |
15 |
Credits charged for this request. |
| x-credits-remaining |
145 |
Your balance afterwards. |
| x-original-format |
pdf |
The format in which the register delivers the document. |
| idempotency-status |
created |
Only with Idempotency-Key: created or replayed.
|
200 · Headers of the example response to the request above, for the Aktueller Abdruck in the example of Hetzner Online GmbH.
Errors
| Status | Cause | What you can do |
|---|---|---|
| 400 |
company_id is not a valid entity_id, or document_type is unknown. |
Send the entity_id instead of a name or register number; write the document type as in the table. |
| 401 | No API key or an invalid one. |
Send the key in the x-api-key header. |
| 402 | Your balance does not cover a document. | Top up credits, then retry. |
| 403 | Your account's email address is not confirmed yet, or the account is blocked. | Open the link in the confirmation email. If the account is blocked, contact support. |
| 404 | This document does not exist for the company, for example a shareholder list for a KG. | Choose another document type. The register makes some documents available only later. |
| 415 | The register delivers this document only as a TIFF image. | Fetch the document directly in the register portal. Nothing is charged. |
| 422 |
The Idempotency-Key was already used with different parameters. |
Use a new key for a new request. |
| 429 | More requests than the per-minute limit allows. |
Wait as many seconds as Retry-After says, then retry. |
| 500, 502 | The register returned an error or an unexpected format. | Retry later. Nothing is charged. |
| 503 |
With async=true there is currently no room for a background fetch. |
Wait as many seconds as Retry-After says, then retry. |
| 504 | The register did not answer in time. |
Retry in a few minutes; Retry-After gives a waiting time. |
For some companies the documents are only available directly in the register portal. The response then points there in register_url; nothing is charged.
Rejected requests cost no credits. How an error response is built is described under Errors.
Good to know
Straight from the register. We fetch documents from the Handelsregister on demand. This can take up to two minutes. If the same document was already fetched in the last 24 hours, it comes right away, in the state of that fetch. The date is in the file name.
Retry-After and nothing is charged; try again in a few minutes.
No waiting with async. With async=true the API answers right away with 202 while the document is still being fetched. Repeat the same request after the seconds given in Retry-After; then the file comes.
If the document is already ready, it comes straight away with 200. If the fetch in the background fails, you get the error on the next retry, at no cost. Every retry counts toward the per-minute limit; only the delivered document is charged. This helps clients with a short timeout, such as serverless functions or AI agents.
1{2 "status": "processing",3 "meta": {4 "message": "The document is being retrieved. Repeat this request after Retry-After seconds to receive it.",5 "retry_after": 20,6 "request_credit_cost": 0,7 "credits_remaining": 1458 }9}
202 · Example response with async=true while the document is being fetched.
Client timeout. Without async, set your client's timeout to at least 120 seconds.
Retry safely. Send a value of your own in the Idempotency-Key header. The same request with the same key is then charged only once within 24 hours. The retry returns the file again, with X-Credits-Charged: 0 and Idempotency-Status: replayed. More under Limits.