# Blog

The Blog API returns the store's blogs and the articles inside a blog. Both endpoints are open to anonymous visitors.

All Ajax API requests should use [locale-aware URLs](/docs/theme/references/ajax-api/#locale-aware-urls) to give visitors a consistent experience.

## List the blogs of the store

```text
GET /{locale}/api/front/blogs
```

List the blogs of the store, with the article count and the storefront path of each blog. Takes no parameters.

### Example request

**Example request**

```javascript
fetch(window.SHOPLAZZA.routes.root + '/api/front/blogs')
  .then((response) => response.json())
  .then((data) => {
    // do something...
  });
```

### Response

**Schema | Example**

- `count` number

  Number of blogs returned.
- `blogs` object[]

  Blogs the article belongs to.

  *   Array \[

  - `id` string

    ID of the blog.
  - `title` string

    Title of the blog.
  - `description` string

    Description of the blog.
  - `seo_title` string

    SEO title.
  - `seo_description` string

    SEO description.
  - `seo_keywords` undefined[]

    SEO keywords.
  - `handle` string

    URL-friendly handle used in the resource URL.
  - `seo_url` string

    Relative URL of the blog.
  - `article_count` number

    Number of articles in the blog.
  - `created_at` string

    Creation time, in ISO-8601 format.
  - `updated_at` string

    Last update time, in ISO-8601 format.
  *   \]

```json
{
  "count": 1,
  "blogs": [
    {
      "id": "9e1a47ab-e22b-4370-bbf0-2309cc3d6c72",
      "title": "Ajax API Probe",
      "description": null,
      "seo_title": "",
      "seo_description": "",
      "seo_keywords": [],
      "handle": "ajax-probe",
      "seo_url": "/blogs/ajax-probe",
      "article_count": 1,
      "created_at": "2026-09-02T13:42:08Z",
      "updated_at": "2026-09-02T13:42:24Z"
    }
  ]
}
```

## List the articles of a blog

```text
GET /{locale}/api/front/blogs/{blog_slug}/articles
```

List the articles of one blog, where `blog_slug` is the handle of the blog.

### Example request

**Example request**

```javascript
fetch(window.SHOPLAZZA.routes.root + '/api/front/blogs/ajax-probe/articles?page=1&per_page=5')
  .then((response) => response.json())
  .then((data) => {
    // do something...
  });
```

### Request parameters

- `blog_slug` string

  The handle of the blog.
- `page` number

  The page of articles to return.
- `per_page` number

  The number of articles per page.

### Response

**Schema | Example**

- `count` number

  Number of articles returned.
- `articles` object[]

  List of articles.

  *   Array \[

  - `id` string

    ID of the article.
  - `title` string

    Title of the article.
  - `excerpt` string

    Short summary of the article.
  - `author` string

    Author of the article.
  - `image` string

    Image attached to the article.
  - `published_at` string

    Publication time, in ISO-8601 format.
  - `handle` string

    URL-friendly handle used in the resource URL.
  - `url` string

    Relative URL of the article.
  - `blogs` object[]

    Blogs the article belongs to.

    *   Array \[

    - `id` string

      ID of the blog.
    - `title` string

      Title of the blog.
    - `url` string

      Relative URL of the blog.
    - `handle` string

      URL-friendly handle used in the resource URL.
    *   \]
  *   \]

```json
{
  "count": 1,
  "articles": [
    {
      "id": "b90f0520-afea-4efd-8c92-3e5751490317",
      "title": "Ajax API Probe Article",
      "excerpt": "Sample article for Ajax API docs.",
      "author": "Docs",
      "image": null,
      "published_at": null,
      "handle": "ajax-probe-article",
      "url": "/blog/ajax-probe-article",
      "blogs": [
        {
          "id": "9e1a47ab-e22b-4370-bbf0-2309cc3d6c72",
          "title": "Ajax API Probe",
          "url": "/blogs/ajax-probe",
          "handle": "ajax-probe"
        }
      ]
    }
  ]
}
```
