Average Sale Price (ASP)
GET https://api.chartmogul.com/v1/metrics/asp
Retrieves the Average Sale Price (ASP) for the specified time period.
curl -X GET "https://api.chartmogul.com/v1/metrics/asp" \
-u YOUR_API_KEY: \
-d start-date=2023-07-31 \
-d end-date=2023-08-31 \
-d interval=month \
-d geo=US \
-d plans=Silver%20Monthly
ChartMogul::Metrics.asp(
start_date: "2023-07-01",
end_date: "2023-08-31",
interval: "month",
geo: "US",
plans: "Silver Monthly",
)
ChartMogul.Metrics.asp(config, {
"start-date": "2023-07-31",
"end-date": "2023-08-31",
interval: "month",
geo: "US",
plans: "Silver Monthly",
});
ChartMogul\Metrics::asp([
"start-date" => "2023-07-31",
"end-date" => "2023-08-31",
"interval" => "month",
"geo" => "US",
"plans" => "Silver Monthly"
]);
api.MetricsRetrieveASP(&cm.MetricsFilter{
StartDate: "2023-07-31",
EndDate: "2023-08-31",
Interval: "month",
Geo: "US",
Plans: "Silver Monthly",
})
chartmogul.Metrics.asp(
config,
start_date="2023-07-31",
end_date="2023-08-31",
interval="month",
geo="US",
plans="Silver Monthly",
)
{
"entries": [
{
"date": "2023-07-31",
"asp": 641,
"percentage-change": 0.0
},
{
"date": "2023-08-31",
"asp": 539,
"percentage-change": -15.91
}
],
"summary": {
"current": 539,
"previous": 500,
"percentage-change": 7.8
}
}
#<ChartMogul::Metrics::ASPs:0x007fa4ec501de0
@entries=[
#<ChartMogul::Metrics::ASP:0x007fa4ec501930
@date=2023-07-31,
@asp=641,
@percentage_change=0.0
>,
#<ChartMogul::Metrics::ASP:0x007fa4ec5013b8
@date=2023-08-31,
@asp=539,
@percentage_change=-15.91
>
],
@summary=
#<ChartMogul::Summary:0x007fa4ec500e18
@current=539,
@previous=500,
@percentage_change=7.8
>
>
{
entries: [
{
date: "2023-07-31",
asp: 641,
"percentage-change": 0.0
},
{
date: "2023-08-31",
asp: 539,
"percentage-change": -15.91
}
],
summary: {
current: 539,
previous: 500,
"percentage-change": 7.8
}
}
ChartMogul\Metrics\ASPs::__set_state(array(
"entries" => Doctrine\Common\Collections\ArrayCollection::__set_state(array(
"elements" => array(
0 => ChartMogul\Metrics\ASP::__set_state(array(
"date" => "2023-07-01",
"asp" => 641,
"percentage_change" => 0.0
)),
1 => ChartMogul\Metrics\ASP::__set_state(array(
"date" => "2023-08-31",
"asp" => 539,
"percentage_change" => -15.91
))
)
)),
"summary" => ChartMogul\Summary::__set_state(array(
"current" => 539,
"previous" => 500,
"percentage_change" => 7.8
)),
));
(*chartmogul.ASPResult)(0xc0420b4f00)({
Entries: ([]*chartmogul.ASPMetrics) (len=2) {
(*chartmogul.ASPMetrics)(0xc042102860)({
Date: (string) (len=10) "2023-07-01",
ASP: (float64) 641,
PercentageChange: (float64) 0.0
}),
(*chartmogul.ASPMetrics)(0xc0421028c0)({
Date: (string) (len=10) "2023-08-31",
ASP: (float64) 539,
PercentageChange: (float64) -15.91
})
},
Summary: (*chartmogul.Summary)(0xc042102900)({
Current: (float64) 539,
Previous: (float64) 500,
PercentageChange: (float64) 7.8
})
})
Metrics(
entries=[
<Metrics{
asp=641.0,
percentage_change=0.0,
date=datetime.date(2023, 7, 1)
}>,
<Metrics{
asp=539.0,
percentage_change=-15.91,
date=datetime.date(2023, 8, 31)
}>
],
summary=<Summary{
current=539.0,
percentage_change=7.8,
previous=500.0
}>
)
Query parameters
start-datedatetime required- The start date of the required period of data. An ISO-8601 formatted date, e.g.
2015-05-12 end-datedatetime required- The end date of the required period of data. An ISO-8601 formatted date, e.g.
2015-05-12 intervalstring optional default: "month"- One of either
month(default),quarteroryear. geostring optional- A comma-separated list of ISO 3166-1 Alpha-2 formatted country codes to filter the results to, e.g.
US,UK,DE. plansstring optional- A comma-separated list of plan UUIDs, external IDs or names (as configured in your ChartMogul account) to filter the results. Plan UUIDs are accepted with or without the
pl_prefix (e.g.,pl_ca7565ce-1973-9351-11ee-9f34ab5816d8,b35fdb9e-1ca2-11ee-90be-6f197565b760). Plan IDs and names are case-sensitive. Spaces in plan names must be URL-encoded (e.g.,Silver%20plan,Gold%20plan,Enterprise%20plan). You can mix plan UUIDs, external IDs and names in a single string, (e.g.,pl_ca7565ce-1973-9351-11ee-9f34ab5816d8,gold_plan,Silver%20plan).
Response
In the response, the entries key contains an object for each interval, with the following data:
date- The date of the end of the interval
asp- The ASP as at the end of the period. This is in your account's selected currency, and is an integer number of cents. Divide it by 100 to obtain the actual value.
percentage-change- The percentage change between the current ASP and ASP from the previous time interval. Will be set to 0.0 if this is the first entry in the response.
The summary key contains the current ASP value, the value 30 days ago and the percentage change between these two measures.