Data api statistics visitsforpath
Yuji Takayama edited this page Jul 10, 2013
·
1 revision
Retrieve visits count for each date from provider (e.g. Google Analytics).
Authorization is required.
This method accepts GET only.
GET https://your-host/your-mt-api.cgi/v1/sites/{blog_id}/stats/path/visits
Parameter | Type | Description |
---|---|---|
blog_id | unsigned integer | The blog ID. |
Parameter | Type | Description |
---|---|---|
startDate | iso 8601 date | This is an required parameter. Start date of data. The format is "YYYY-MM-DD". |
endDate | iso 8601 date | This is an required parameter. End date of data. The format is "YYYY-MM-DD". |
limit | unsigned integer | This is an optional parameter. Maximum number of paths to retrieve. Default is 10. |
offset | string | This is an optional parameter. 0-indexed offset. Default is 0. |
path | string | This is an optional parameter. The target path of data to retrieve. Default is the path of the current site. |
Do not supply a request body.
Parameter | Type | Description |
---|---|---|
totalResults | unsigned integer | The total number of paths found that by the requesst. |
items | ARRAY | An array of Items for path resource. |
totals | Object | |
totals.visits | unsigned integer | The sum total of the visits in the specified period. |
Code | Description |
---|---|
200 | no error |
404 | Readied provider is not found |
500 | Error retrieving statistics data: [_1]: [_2] |
GET /mt-api.cgi/v1/sites/1/stats/path/visits?startDate=2013-01-01&endDate=2013-01-31
Host: www.example.com
HTTP/1.0 200 OK
Content-Type: application/json
Content-length: ...