# API call

After you are properly authenticated, you can start exploring the Foxentry API.

## Available endpoints

Base URL is <https://api.foxentry.com>

| Name | URL | Description |
| --- | --- | --- |
| Validate company data | /company/validate | Validation of company parameters and their combinations. |
| Search company | /company/search | Company autocomplete. |
| Get company data | /company/get | More information about a company. |
| Validate e-mail | /email/validate | Validation of e-mail addresses and deliverability check. |
| Validate location data | /location/validate | Validation of location data and their combinations. |

## Rate limiting

Requests are rate limited per IP address, project and endpoint. The current limit is **5 000 requests per 900 seconds**. Check the response headers `foxentry-rate-limit`, `foxentry-rate-limit-period` and `foxentry-rate-limit-remaining`.

## Request structure

Important: specify the API version

If you do not send `Api-Version`, the API uses the latest version. Pin a specific version, for example `2.1`, and update it manually. Older versions stay available for 6 months.

### Header

In the header you specify the **API version**. You can also ask to **include request details**, so the request is returned in the response. Bearer authorization is part of the header too, see [Authentication](auth.html).

### Request body

- `request` object required

  Wraps the whole request.
- `customId` string | null

  Custom ID assigned by you. Example: `customer567914`
- `query` object required

  Parameters you want to validate or get information about.
- `options` object

  Options that change how the validator behaves.
- `client` object

  Information about your user, to make search results more relevant.

The main part of a request is **query**. **Options** is the second most important part. **customId** and **client** are optional.

1. Authenticate with your API key.
2. Pin the API version.
3. Send the query.

**Request example**

```curl
curl --request POST \
  --url https://api.foxentry.com/email/validate \
  --header 'Api-Version: 2.1' \
  --header 'Foxentry-Include-Request-Details: true' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '
{
  "request": {
    "query": { "email": "p.novak@gamil.com" },
    "options": { "validationType": "extended" },
    "customId": "customer567914"
  }
}
'
```
