Skip to main content
GET
/
api
/
v2
/
stats
/
top-sales
Get top sales
curl --request GET \
  --url https://{search_zone}-api.doofinder.com/api/v2/stats/top-sales \
  --header 'Authorization: <api-key>'
{
  "results": [
    {
      "avg_price": 500,
      "dfid": "070cdedbb32a134ad74db5ac9cd93b36@product@74446c03dd1ae404c61723db51a6766b",
      "sum_amount": 30,
      "title": "coffee capsules"
    },
    {
      "avg_price": 200.25,
      "dfid": "070cdedab32a134ad74db5ac9cd93b36@product@744d6c03dd1ae404c61723db51a6766b",
      "sum_amount": 20,
      "title": "pencils"
    }
  ],
  "total": 2,
  "total_count": 2
}

Authorizations

Authorization
string
header
required

Doofinder API key. Pass it as: Authorization: Token <api_key>

Query Parameters

from
string
required

Start date of the period in the format of UNIX timestamp or YYYYMMDD.

Pattern: ^20\d{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$|^\d{10}|^\d{13}$
to
string
required

End date of the period in the format of UNIX timestamp or YYYYMMDD.

Pattern: ^20\d{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$|^\d{10}$|^\d{13}
hashids
string[]

Unique id of the search engine. It accepts an array of values. If you want to work with all user search engines just don't send this parameter. Arrays parameters must be in the format param[]=value.

Pattern: ^[a-f0-9]{32}$
hashid
string[]
Pattern: ^[a-f0-9]{32}$
tz
string
default:Etc/UTC

The timezone for the given dates, by default, assumes ETC/UTC. In naming your time zones, you must stick to those indicated in the TZ database name column here

format
enum<string>
default:json

Indicates which response format should be used

Available options:
json,
csv
device
enum<string>

Filter by kind of device.

Available options:
desktop,
mobile
aggregate
boolean
default:true

Flag to indicate when to aggregate all Search Engines stats data.

Response

Top sales retrieved.

Top Stats results for Sales.

results
object[]
total
integer

Count of all top sales retrieved.

Example:

1

total_count
integer

Count of all top sales retrieved.

Example:

12