Skip to content

Get blog statistics

GET
/stores/{storeRef}/blog/posts/stats/overview
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

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
by_status
required

Posts by status.

object
draft
required

Posts in draft.

number
published
required

Published posts.

number
scheduled
required

Scheduled posts.

number
unlisted
required

Unlisted posts.

number
by_month
required

Posts by the month they were created in, oldest first.

Array<object>
object
month
required

Month as YYYY-MM.

string
count
required

Posts created in that month.

number
total_posts
required

All posts that are not deleted.

number
published_posts
required

Published posts.

number
draft_posts
required

Posts in draft.

number
scheduled_posts
required

Scheduled posts.

number
total_views
required

Sum of the views of all posts.

number
total_categories
required

Number of categories.

number
total_tags
required

Number of tags.

number
total_comments
required

Number of comments, approved or not.

number
pending_comments
required

Number of comments waiting for approval.

number

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.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

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.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}