# Usage History

> Get your usage history between two dates.

<RequestExample>

```bash title="cURL" icon="terminal"
curl --request GET \
  --url 'https://api.copyleaks.com/v3/scans/usages/history?start=01-01-2020&end=31-01-2020' \
  --header 'Authorization: Bearer YOUR_LOGIN_TOKEN'
```

```python title="Python" icon="python"
from copyleaks.copyleaks import Copyleaks

auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY")

csv_history = Copyleaks.usages_history_csv(auth_token, "01-01-2020", "31-01-2020")
print(csv_history)
```

</RequestExample>

<ResponseExample>

```text 200 OK
CSV file attached to the response.
```

</ResponseExample>

This endpoint allows you to export your usage history between two dates.

The output results will be exported to a csv file and it will be attached to the response.

<Warning>
**Authentication Required.** You need to login with a user and API key in order to access this method. Add this HTTP header to your request:

**Authorization: Bearer &lt;Your-Login-Token&gt;**
</Warning>

## Request

### Query Parameters

<ParamField query="start" type="string" required>
  The start date to collect usage history from.

      Format: `dd-MM-yyyy`

      Example: `01-01-2020`
</ParamField>
<ParamField query="end" type="string" required>
  The end date to collect usage history from.

      Format: `dd-MM-yyyy`

      Example: `31-01-2020`
</ParamField>

### Headers

```http
Authorization: Bearer YOUR_LOGIN_TOKEN
```

## Responses

<Tabs>
  <Tab title="200">
    <Check>**200 OK** - The data was exported. Example: csv file will be attached to the response.</Check>
  </Tab>
  <Tab title="400">
    <Warning>**400 Bad Request** - Bad request. Wrong input parameters were provided.</Warning>
  </Tab>
  <Tab title="401">
    <Warning>**401 Unauthorized** - Authorization has been denied for this request.</Warning>
  </Tab>
</Tabs>
