# EDD REST API - File Downloads

 The [EDD REST API](https://easydigitaldownloads.com/docs/edd-rest-api-introduction/) provides the /file-download-logs/ endpoint, which allows you to retrieve logs for a given site. A basic download-logs query looks like this:

```
https://example.com/edd-api/file-download-logs/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70
```

 A sample download-logs response looks like this:

```
{
    &quot;download_logs&quot;: [
        {
            &quot;ID&quot;: 257,
            &quot;user_id&quot;: &quot;1&quot;,
            &quot;product_id&quot;: 68,
            &quot;product_name&quot;: &quot;Ebook: I am Pippin Williamson, and so can YOU.&quot;,
            &quot;customer_id&quot;: &quot;1&quot;,
            &quot;payment_id&quot;: &quot;254&quot;,
            &quot;file&quot;: &quot;Be Kind To Your Web Footed Friends&quot;,
            &quot;ip&quot;: &quot;68.56.68.4&quot;,
            &quot;date&quot;: &quot;2015-11-03 18:36:05&quot;
        },
        {
            &quot;ID&quot;: 256,
            &quot;user_id&quot;: &quot;1&quot;,
            &quot;product_id&quot;: 68,
            &quot;product_name&quot;: &quot;Ebook: I am Pippin Williamson, and so can YOU.&quot;,
            &quot;customer_id&quot;: &quot;1&quot;,
            &quot;payment_id&quot;: &quot;254&quot;,
            &quot;file&quot;: &quot;Be Kind To Your Web Footed Friends&quot;,
            &quot;ip&quot;: &quot;68.56.68.4&quot;,
            &quot;date&quot;: &quot;2015-11-03 18:34:00&quot;
        }
    ],
    &quot;request_speed&quot;: 0.076191902160645
}
```

##### Download-logs Variables

###### customer

 Appending &amp;customer=user@example.com will narrow the log search to that email address. Example:

```
https://yoursite.com/edd-api/file-download-logs/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70&amp;customer=user@example.com
```

#### Error Messages

 If the query you have passed to the EDD API returns an error, the response will come back like this:

```
{
    &quot;error&quot;: &quot;Invalid query!&quot;
}
```

 Each query method in the API includes meaningful error messages to help you figure out what you have done wrong.

 For example, if you attempt to perform a stats query with a date range but enter an end date that is before the start date, you will get an error like this:

```
{
    &quot;error&quot;: &quot;The end date must be later than the date date!&quot;
}
```