> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trmlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TRM Sanctions API (v1)

<Columns cols={2}>
  <Card title="E-mail" icon="envelope" href="mailto:contact@trmlabs.com" horizontal />

  <Card title="License (Proprietary API)" icon="copyright" href="http://www.trmlabs.com/" horizontal />
</Columns>

## Introduction

The TRM API is organized around REST.

Our API has predictable resource-oriented URLs, accepts [form-encoded](https://en.wikipedia.org/wiki/POST_\(HTTP\)#Use_for_submitting_web_forms) request bodies, returns [JSON-encoded](http://www.json.org/) responses, and uses standard HTTP response codes, authentication, and verbs.

You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

## Errors

TRM uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the `2xx` range indicate success. Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.). Codes in the `5xx` range indicate an error with TRM's servers (these are rare).

The TRM API uses the following error codes:

| Error Code | Meaning                                                                                                |
| :--------- | :----------------------------------------------------------------------------------------------------- |
| 400        | Bad Request -- Your request is invalid.                                                                |
| 401        | Unauthorized -- Your API key is wrong.                                                                 |
| 404        | Not Found -- The specified resource could not be found.                                                |
| 405        | Method Not Allowed -- You tried to access an object with an invalid method.                            |
| 406        | Not Acceptable -- You requested a format that isn't json.                                              |
| 429        | Too Many Requests -- You have exceeded your rate limit. See below for details on handling rate limits. |
| 500        | Internal Server Error -- We had a problem with our server. Try again later.                            |
| 503        | Service Unavailable -- We're temporarily offline for maintenance. Please try again later.              |

## Rate Limiting

Traffic to the TRM Sanctions API is rate limited.

Requests that come in faster than this limit may receive an error response with HTTP status code 429. If you are seeing this response, the solution is to retry these requests after the suggested interval. In general, your application should meter requests to try to stay at or below the limit.

Responses to TRM API requests include several headers to help you work with our rate limit. Responses with a 429 error will include a `Retry-After` header recommending a number of seconds to wait before retrying the request.

By default, the API is limited to 1 req/sec, and maximum of 100 req/day. For those who need more screens, you can request an API Key [here](https://www.trmlabs.com/products/sanctions).

## Headers on a successful request

```bash theme={null}
HTTP/1.1 201 Created
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 8
X-RateLimit-Reset: 1613700051
```

## Headers on a rate-limited request

```bash theme={null}
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1613700051
Retry-After: 1
```
