# Blog

        <p>In addition to an online storefront, Shopify shops come with a built-in blogging engine, allowing a shop to have one or more blogs.</p>

        {{ '/api/reference/blog.png' | image }}

        <p>Shop owners are encouraged to use blogs to:</p>
        <ul>
          <li>Make announcements</li>
          <li>Talk about their products in more detail</li>
          <li>Show off their expertise</li>
          <li>Connect with their customers and</li>
          <li>Boost their shop's search engine rankings</li>
        </ul>

        <p>Shopify blogs are like most other blogs: a content management system for articles posted in reverse chronological order. Articles can be posted under one or more user-defined categories and tagged with one or more user-defined tags, with an option to allow readers to post comments to articles. An Atom feed is automatically generated for each blog, allowing for syndication. The search functionality built into every shop also searches the text in blog articles.</p>

        <p>Blogs are meant to be used as a type of magazine or newsletter for the shop, with content that changes over time. If your shop needs a static page (such as an "About Us" page), we recommend that you use a Page instead.</p>

        <p>Also see the <a href="/docs/admin-api/rest/reference/online-store/article">Article resource</a> for managing blog articles.</p>

## Resource Properties

### Blog

* commentable:         <p>Indicates whether readers can post comments to the blog and if comments are moderated or not. Possible values are:</p>
        <ul>
          <li><strong>no (default)</strong>: Readers cannot post comments to blog articles.</li>
          <li><strong>moderate</strong>: Readers can post comments to blog articles, but comments must be moderated before they appear.</li>
          <li><strong>yes</strong>: Readers can post comments to blog articles without moderation.</li>
        </ul>

  * Type: x-string
  * Example: "no"
* created_at: The date and time when the blog was created. The API returns this value in <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 format</a>.
  * Type: x-string
  * Example: "2012-03-13T16:09:54-04:00"
* feedburner: FeedBurner is a web feed management provider and can be enabled to provide custom RSS feeds for Shopify bloggers. Google has stopped supporting FeedBurner, and new or existing blogs that are not already integrated with FeedBurner can't use the service. This property will default to blank unless FeedBurner is enabled.
  * Type: x-string
  * Example: nil
* feedburner_location: The URL that points to the FeedBurner location for blogs that have FeedBurner enabled. Google has stopped supporting FeedBurner, and new or existing blogs that are not already integrated with FeedBurner can't use the service. This property will default to blank unless FeedBurner is enabled
  * Type: x-string
  * Example: nil
* handle: A human-friendly unique string that is automatically generated from the title if no handle is sent during the creation of a blog. Duplicate handles are appended with an incremental number, for example, `blog-2`. The handle is customizable and is used by the Liquid templating language to refer to the blog. If you change the handle of a blog, then it can negatively affect the SEO of the shop. We recommend that you create a URL redirect to avoid any SEO issues.
  * Type: x-string
  * Example: "apple-blog"
* id: A unique numeric identifier for the blog.
  * Type: x-string
  * Example: 241253187
* metafields:           <p>Attaches additional metadata to a store's resources:</p>
          <ul>
            <li><strong>key (required)</strong>: Identifier for the metafield (maximum of 30 characters).</li>
            <li><strong>namespace (required)</strong>: Container for a set of metadata. Namespaces help distinguish between metadata you created and metadata created by another individual with a similar namespace (maximum of 20 characters).</li>
            <li><strong>value (required)</strong>: Information to be stored as metadata.</li>
            <li><strong>type (required)</strong>: The metafield's information type. Refer to the <a href="/apps/metafields/types">full list of types</a>.</li>
            <li><strong>description (optional)</strong>: Additional information about the metafield.</li>
          </ul>
          <p>For more information on attaching metadata to Shopify resources, see the <a href="/api/admin-rest/latest/resources/metafield">Metafield</a> resource.</p>

  * Type: array
  * Example: [{"key"=>"sponsor", "value"=>"Shopify", "value_type"=>"string", "namespace"=>"global", "description"=>"The blog sponsor"}]
* tags: A list of tags associated with the 200 most recent blog articles. Tags are additional short descriptors formatted as a string of comma-separated values. For example, if an article has three tags: tag1, tag2, tag3. Tags are limited to 255 characters.
  * Type: x-string
  * Example: "tagged"
* template_suffix: States the name of the template a blog is using if it is using an alternate template. If a blog is using the default blog.liquid template, the value returned is "null".
  * Type: x-string
  * Example: nil
* title: The title of the blog.
  * Type: x-string
  * Example: "My Blog"
* updated_at: The date and time when changes were last made to the blog's properties. Note that this is not updated when creating, modifying or deleting articles in the blog. The API returns this value in <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 format</a>.
  * Type: x-string
  * Example: "2021-12-01T14:52:12-04:00"
* admin_graphql_api_id: The GraphQL GID of the blog.
  * Type: x-string
  * Example: "gid://shopify/OnlineStoreBlog/241253187"
## Retrieve a list of all blogs

Retrieve a list of all blogs. <strong>Note:</strong> This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to <a href='/api/usage/pagination-rest'>Make paginated requests to the REST Admin API</a>.

### Endpoint
/admin/api/#{api_version}/blogs.json (GET)

### Parameters
* api_version (required): 
* fields: comma-separated list of fields to include in the response
* handle: Filter by blog handle
* limit: The maximum number of results to retrieve.
* since_id: Restrict results to after the specified ID

### Responses
#### 200
Retrieve a list of all blogs

Examples:
##### Get all blogs for a shop
Request:
```
GET /admin/api/unstable/blogs.json
```

Response:
```
HTTP/1.1 200 OK
{"blogs":[{"id":382285388,"handle":"banana-blog","title":"A Gnu Blog","updated_at":"2006-02-02T19:00:00-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"","admin_graphql_api_id":"gid://shopify/Blog/382285388"},{"id":241253187,"handle":"apple-blog","title":"Mah Blog","updated_at":"2006-02-01T19:00:00-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"Announcing, Mystery","admin_graphql_api_id":"gid://shopify/Blog/241253187"}]}
```
##### Get all blogs for a shop after a specified ID
Request:
```
GET /admin/api/unstable/blogs.json
```

Response:
```
HTTP/1.1 200 OK
{"blogs":[{"id":382285388,"handle":"banana-blog","title":"A Gnu Blog","updated_at":"2006-02-02T19:00:00-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"","admin_graphql_api_id":"gid://shopify/Blog/382285388"},{"id":1008414251,"handle":"apple-main-blog","title":"Apple main blog","updated_at":"2025-01-02T11:30:30-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:30:30-05:00","template_suffix":null,"tags":"","admin_graphql_api_id":"gid://shopify/Blog/1008414251"}]}
```
## Create a new Blog

Create a new blog

### Endpoint
/admin/api/#{api_version}/blogs.json (POST)

### Parameters
* api_version (required): 
* title (required): The title of the blog. Maximum length: 255 characters.

### Responses
#### 201
Create a new Blog

Examples:
##### Create a new empty blog
Request:
```
POST /admin/api/unstable/blogs.json
{"blog":{"title":"Apple main blog"}}
```

Response:
```
HTTP/1.1 201 Created
{"blog":{"id":1008414248,"handle":"apple-main-blog","title":"Apple main blog","updated_at":"2025-01-02T11:30:23-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:30:23-05:00","template_suffix":null,"tags":"","admin_graphql_api_id":"gid://shopify/Blog/1008414248"}}
```
##### Create a new empty blog with a metafield
Request:
```
POST /admin/api/unstable/blogs.json
{"blog":{"title":"Apple main blog","metafields":[{"key":"sponsor","value":"Shopify","type":"single_line_text_field","namespace":"global"}]}}
```

Response:
```
HTTP/1.1 201 Created
{"blog":{"id":1008414250,"handle":"apple-main-blog","title":"Apple main blog","updated_at":"2025-01-02T11:30:27-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:30:27-05:00","template_suffix":null,"tags":"","admin_graphql_api_id":"gid://shopify/Blog/1008414250"}}
```
#### 422
Create a new Blog

Examples:
##### Trying to create a blog without a title will return an error
Request:
```
POST /admin/api/unstable/blogs.json
{"blog":{"body":"foobar"}}
```

Response:
```
HTTP/1.1 422 Unprocessable Entity
{"errors":{"title":["can't be blank"]}}
```
## Receive a count of all Blogs

Get a count of all blogs

### Endpoint
/admin/api/#{api_version}/blogs/count.json (GET)

### Parameters
* api_version (required): 

### Responses
#### 200
Receive a count of all Blogs

Examples:
##### Get the blogs count for a shop
Request:
```
GET /admin/api/unstable/blogs/count.json
```

Response:
```
HTTP/1.1 200 OK
{"count":2}
```
## Receive a single Blog

Get a single blog by its ID

### Endpoint
/admin/api/#{api_version}/blogs/{blog_id}.json (GET)

### Parameters
* api_version (required): 
* blog_id (required): 
* fields: comma-separated list of fields to include in the response

### Responses
#### 200
Receive a single Blog

Examples:
##### Get a single blog
Request:
```
GET /admin/api/unstable/blogs/241253187.json
```

Response:
```
HTTP/1.1 200 OK
{"blog":{"id":241253187,"handle":"apple-blog","title":"Mah Blog","updated_at":"2006-02-01T19:00:00-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"Announcing, Mystery","admin_graphql_api_id":"gid://shopify/Blog/241253187"}}
```
##### Get the id and title of a single blog
Request:
```
GET /admin/api/unstable/blogs/241253187.json
```

Response:
```
HTTP/1.1 200 OK
{"blog":{"id":241253187,"title":"Mah Blog"}}
```
## Modify an existing Blog

Update a blog

### Endpoint
/admin/api/#{api_version}/blogs/{blog_id}.json (PUT)

### Parameters
* api_version (required): 
* blog_id (required): 

### Responses
#### 200
Modify an existing Blog

Examples:
##### Add a metafield to an existing blog
Request:
```
PUT /admin/api/unstable/blogs/241253187.json
{"blog":{"id":241253187,"metafields":[{"key":"sponsor","value":"Shopify","type":"single_line_text_field","namespace":"global"}]}}
```

Response:
```
HTTP/1.1 200 OK
{"blog":{"title":"Mah Blog","handle":"apple-blog","id":241253187,"updated_at":"2006-02-01T19:00:00-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"Announcing, Mystery","admin_graphql_api_id":"gid://shopify/Blog/241253187"}}
```
##### Update an existing blog title
Request:
```
PUT /admin/api/unstable/blogs/241253187.json
{"blog":{"id":241253187,"title":"IPod Updates"}}
```

Response:
```
HTTP/1.1 200 OK
{"blog":{"title":"IPod Updates","handle":"apple-blog","id":241253187,"updated_at":"2025-01-02T11:30:24-05:00","commentable":"no","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"Announcing, Mystery","admin_graphql_api_id":"gid://shopify/Blog/241253187"}}
```
##### Update an existing blog title and handle and also activate comments
Request:
```
PUT /admin/api/unstable/blogs/241253187.json
{"blog":{"id":241253187,"title":"IPod Updates","handle":"ipod-updates","commentable":"moderate"}}
```

Response:
```
HTTP/1.1 200 OK
{"blog":{"title":"IPod Updates","handle":"ipod-updates","commentable":"moderate","id":241253187,"updated_at":"2025-01-02T11:30:23-05:00","feedburner":null,"feedburner_location":null,"created_at":"2025-01-02T11:29:59-05:00","template_suffix":null,"tags":"Announcing, Mystery","admin_graphql_api_id":"gid://shopify/Blog/241253187"}}
```
## Remove an existing Blog

Delete a blog

### Endpoint
/admin/api/#{api_version}/blogs/{blog_id}.json (DELETE)

### Parameters
* api_version (required): 
* blog_id (required): 

### Responses
#### 200
Remove an existing Blog

Examples:
##### Remove an existing blog from a shop
Request:
```
DELETE /admin/api/unstable/blogs/241253187.json
```

Response:
```
HTTP/1.1 200 OK
{}
```