# EDD REST API - Endpoints

The [EDD REST API](&lt;The EDD REST API (link this to overview) includes X endpoints for accessing information&gt;) includes six endpoints for accessing information, each for performing a specific kind of request:

- **stats** - For retrieving earnings/sales stats specific dates, date ranges, and specific products.
- **products** - For retrieving info about store products.
- **customers** - For retrieving customer stats.
- **sales** - For retrieving recent sales and info about each sale (items purchased, buyer, amount, etc).
- **discounts** - For retrieving info about all available discounts.
- **download-logs** - For retrieving logs of file downloads.

The endpoints are used like so: ```
https://example.com/edd-api//
```

For example: ```
https://example.com/edd-api/sales/
```

When combined with the API key and token, the complete URL looks like this: ```
https://example.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70
```

### Visibility

All endpoints require the API key and token except for the products endpoint. This is because products are intended to be public at all times by default. ### Response Format

The response given by the EDD API is available in two formats: - [JSON](https://en.wikipedia.org/wiki/JSON) (default)
- [XML](https://en.wikipedia.org/wiki/XML)

To specify the format returned (jSON will be used if none is specified), simply add the *format* argument to the URL: ```
https://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&amp;token=5f9432f3ffa5945755ebc66179810d70&amp;format=xml
```

A sample JSON response looks like this: ```
{
    &quot;sales&quot;: [
        {
            &quot;ID&quot;: 611,
            &quot;subtotal&quot;: &quot;20&quot;,
            &quot;tax&quot;: 0,
            &quot;fees&quot;: false,
            &quot;total&quot;: &quot;20&quot;,
            &quot;gateway&quot;: &quot;manual&quot;,
            &quot;email&quot;: &quot;johntest23@test.com&quot;,
            &quot;date&quot;: &quot;2013-02-25 11:42:05&quot;,
            &quot;products&quot;: [
                {
                    &quot;name&quot;: &quot;Simple Notices Pro&quot;,
                    &quot;price&quot;: &quot;20&quot;,
                    &quot;price_name&quot;: &quot;Price one&quot;
                }
            ]
        }
    ]
}
```

A sample XML response (for the same query) looks like this: ```
  
    611
    20
    0
    false
    20
    manual
    johntest23@test.com
    2013-02-25 11:42:05
    
      Simple Notices Pro
      20
      Price one
    
  

```

### Optional URL Variables

You can add additional URL variables in order to adjust the output that is given. Here are a few examples of ways you can do that. - **Number**: By default, the API will show 10 results per page, if that&#039;s what you have set under your Reading settings in WordPress. But if you want to change that for a specific API call, you can add &quot;&amp;number=11&quot; to the URL to get a different number of results per page. In this example, you would get 11 results.
- **Page**: By default, the API will show page number 1 of the results. If you want to change that for a specific API call, you can add &quot;&amp;page=2&quot; to the URL to get a different page of results.