Get blog statistics
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/blog/posts/stats/overview';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/stores/example/blog/posts/stats/overview \ --header 'x-api-key: <x-api-key>'Returns post counts by status and by month, total views, and category, tag and comment totals for the store’s blog.
Required scopes: read:blog
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Responses
Section titled “Responses”object
Posts by status.
object
Posts in draft.
Published posts.
Scheduled posts.
Unlisted posts.
Posts by the month they were created in, oldest first.
object
Month as YYYY-MM.
Posts created in that month.
All posts that are not deleted.
Published posts.
Posts in draft.
Scheduled posts.
Sum of the views of all posts.
Number of categories.
Number of tags.
Number of comments, approved or not.
Number of comments waiting for approval.
Example generated
{ "by_status": { "draft": 1, "published": 1, "scheduled": 1, "unlisted": 1 }, "by_month": [ { "month": "example", "count": 1 } ], "total_posts": 1, "published_posts": 1, "draft_posts": 1, "scheduled_posts": 1, "total_views": 1, "total_categories": 1, "total_tags": 1, "total_comments": 1, "pending_comments": 1}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}