Skip to main content
Every request to the DarknetSearch API carries an API key in the X-API-Key header. A key belongs to one organization and acts as that organization. You create keys in the dashboard and send the same key on every call. You do not log in, and there is no token to exchange or refresh. All requests go to https://client-api.leak.center. Every endpoint path starts with /api/.

What an API key is

  • It belongs to one organization. The dashboard calls an organization a workspace. The key belongs to the workspace you are in when you create it. Every request made with it acts as that organization and counts toward its API allowance.
  • It starts with dnst_. The dashboard lists only the first 12 characters, followed by ….
  • It is shown once. The dashboard shows the full key right after you create it. DarknetSearch stores a hash of the key and its first 12 characters, so nobody can show you the full key again.
  • It works on its own. Each key is separate. Revoking one key leaves your other keys working.
  • It can expire. You choose when you create it: never, 30 days, 90 days or 1 year.
API access depends on the plan. The organization’s plan must include an API Calls allowance. Without one, Manage → API tokens explains that API access is not included in the plan and offers no Create token button.

Create a key

Org Admins and System Admins can manage API keys.
1

Open API tokens

Sign in to the dashboard. In the sidebar, open Manage → API tokens. The key you create belongs to the workspace you are in. If you manage client workspaces, pick the workspace first in the switcher at the top of the sidebar.
2

Name the key and pick an expiry

Click Create token. Enter a Name you will recognize in the list, up to 100 characters, for example SIEM integration. Under Expires, choose Never expires, 30 days, 90 days or 1 year. Click Create token.
3

Copy the key

The Save your API token dialog shows the full key. Copy it into your secret manager, then click I’ve saved it. The key is not shown again. If you lose it, revoke it and create a new one.
The list shows each key’s Name, the start of the Key, the date it was Created and when it Expires.

Send the key

Send the key in the X-API-Key header on every request. Send no Authorization header alongside it. A good first call is get_direct_org_info. It returns the organization the key belongs to, which confirms the key is valid and shows which organization it acts as. It answers even when the organization has no license in force, so other calls can still return 403.
The response is trimmed here. See get_direct_org_info in the API reference for every field.

Keep the key secret

Anyone who holds the key can act as your organization. Handle it like a password.
  • Call the API from a server. Use your backend, a script or your SIEM. The API does not accept the X-API-Key header from browser pages on other websites, so a web front end cannot send it directly.
  • Store the key in a secret manager or an environment variable. Keep it out of source code, logs and version control.
  • Create one key per integration. Name each key after the integration that uses it. You can then revoke one key without breaking the others.

Expiry, revocation and rotation

An expired or revoked key fails on the next request:
  • Expired keys stay in the list, marked Expired, until you revoke them. You cannot extend a key. Create a new one.
  • Revoked keys leave the list. To revoke a key, open Manage → API tokens, click Revoke on its row, and confirm with Revoke token. Anything still using the key stops working at once. You cannot undo a revocation.
To rotate a key without downtime:
1

Create the new key

Create a key for the same integration, with a name that tells the two apart.
2

Switch the integration

Put the new key in your secret store and deploy. Both keys work during the switch. Call get_direct_org_info with the new key to confirm it is valid and acts as the right organization.
3

Revoke the old key

Revoke the old key in Manage → API tokens.

Errors

When the API Calls allowance is used up, retry_after_seconds and the Retry-After header count down to the start of the next window, which can be days away:
Queue the work until reset_at instead of retrying in a loop. If the plan’s API Calls allowance is 0, every call returns this response with "limit": 0.

Usage and limits

Every request made with a key counts toward two limits for its organization: a per-second limit for API traffic, and the plan’s API Calls allowance, which is monthly on standard plans.
  • Only 2xx responses use up the allowance. A call that ends in any other status is refunded. A call rejected with 401, 403 or 429 is never counted against the allowance. get_api_call_usage still lists 403 and 429 responses in its per-status counts.
  • Every 2xx and 429 response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. X-RateLimit-Reset is the number of seconds until that limit resets. The headers describe whichever limit has the fewest requests left. On a 429 they describe the limit you hit.

Client organizations

A partner serves clients in one of two ways. The API treats both the same: a key acts as one organization.
  • From your own organization. Most partners do this. Register each client’s domains and other assets in your own organization with organization_assets_create or under Manage → Assets, then monitor and scan them with your own key. Only your team signs in, and every client uses your plan, allowances and slots. Use label on each asset to note which client it belongs to.
  • From a client workspace. A client workspace is a separate organization, bought for a client that signs in to the dashboard itself, with its own users and plan. The API calls it a client organization: its profile’s main_org_id is your organization’s id. It needs its own key. As a System Admin, pick the client workspace in the workspace switcher, open Manage → API tokens and create the key there. It belongs to that client workspace.
A key created for your own organization cannot query a client workspace, and a request that names any other organization returns 403. A client workspace’s plan must include an API Calls allowance, and its key’s traffic counts toward that workspace’s allowance, not yours.

Where to manage keys

You create, review and revoke keys in the dashboard.

Endpoints