test2

Blog

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

Shop owners are encouraged to use blogs to:

  • Make announcements
  • Talk about their products in more detail
  • Show off their expertise
  • Connect with their customers and
  • Boost their shop's search engine rankings

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.

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.

Also see the Article resource for managing blog articles.


The Blog object

Properties

commentable

Indicates whether readers can post comments to the blog and if comments are moderated or not. Possible values are:

  • no (default): Readers cannot post comments to blog articles.
  • moderate: Readers can post comments to blog articles, but comments must be moderated before they appear.
  • yes: Readers can post comments to blog articles without moderation.

created_at
read-only
The date and time when the blog was created. The API returns this value in ISO 8601 format.

feedburner
Feedburner is a web feed management provider and can be enabled to provide custom RSS feeds for Shopify bloggers. This property will default to blank or "null" unless feedburner is enabled through the shop admin.

feedburner_location
URL to the feedburner location for blogs that have enabled feedburner through their store admin. This property will default to blank or "null" unless feedburner is enabled through the shop admin.

handle
A human-friendly unique string for a blog automatically generated from its title. This handle is used by the Liquid templating language to refer to the blog.

id
read-only
A unique numeric identifier for the blog.

metafield

Attaches additional metadata to a store's resources:

  • key (required): Identifier for the metafield (maximum of 30 characters).
  • namespace (required): 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).
  • value (required): Information to be stored as metadata.
  • value_type (required): States whether the information in the value is stored as a 'string' or 'integer.'
  • description (optional): Additional information about the metafield.

tags
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.

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".

title
The title of the blog.

updated_at
read-only
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 ISO 8601 format.
Was this section helpful?
{}
The Blog object
                        
                        
1
{
2
"commentable": "no",
3
"created_at": "2012-03-13T16:09:54-04:00",
4
"feedburner": null,
5
"feedburner_location": null,
6
"handle": "apple-blog",
7
"id": 241253187,
8
"metafield": {
9
"key": "new",
10
"value": "newvalue",
11
"namespace": "global",
12
"value_type": "string"
13
},
14
"tags": "tagged",
15
"template_suffix": null,
16
"title": "My Blog",
17
"updated_at": "2006-02-01T19:00:00-05:00"
18
}

post
Create a new Blog

Create a new blog

Parameters


api_version
string
required
Was this section helpful?
post
/admin/api/2021-10/blogs.json
Copy
curl -d '{"blog":{"title":"Apple main blog"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
                        
1
HTTP/1.1 201 Created
2
{
3
"blog": {
4
"id": 1008414251,
5
"handle": "apple-main-blog",
6
"title": "Apple main blog",
7
"updated_at": "2021-10-01T16:45:34-04:00",
8
"commentable": "no",
9
"feedburner": null,
10
"feedburner_location": null,
11
"created_at": "2021-10-01T16:45:34-04:00",
12
"template_suffix": null,
13
"tags": "",
14
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"
15
}
16
}

Examples

Was this section helpful?
post
/admin/api/2021-10/blogs.json
Copy
                  
curl -d '{"blog":{"title":"Apple main blog"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
                          
1
HTTP/1.1 201 Created
2
{
3
"blog": {
4
"id": 1008414251,
5
"handle": "apple-main-blog",
6
"title": "Apple main blog",
7
"updated_at": "2021-10-01T16:45:34-04:00",
8
"commentable": "no",
9
"feedburner": null,
10
"feedburner_location": null,
11
"created_at": "2021-10-01T16:45:34-04:00",
12
"template_suffix": null,
13
"tags": "",
14
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"
15
}
16
}

get
Retrieve a list of all blogs

Retrieve a list of all blogs. Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.

Parameters


api_version
string
required

fields
comma-separated list of fields to include in the response

handle
Filter by blog handle

limit
≤ 250
default 50
The maximum number of results to retrieve.

since_id
Restrict results to after the specified ID
Was this section helpful?
get
/admin/api/2021-10/blogs.json
Copy
                
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
              
                      
                      	
1
HTTP/1.1 200 OK
2
{
3
"blogs": [
4
{
5
"id": 382285388,
6
"handle": "banana-blog",
7
"title": "A Gnu Blog",
8
"updated_at": "2006-02-02T19:00:00-05:00",
9
"commentable": "no",
10
"feedburner": null,
11
"feedburner_location": null,
12
"created_at": "2021-10-01T16:42:46-04:00",
13
"template_suffix": null,
14
"tags": "",
15
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"
16
},
17
{
18
"id": 241253187,
19
"handle": "apple-blog",
20
"title": "Mah Blog",
21
"updated_at": "2006-02-01T19:00:00-05:00",
22
"commentable": "no",
23
"feedburner": null,
24
"feedburner_location": null,
25
"created_at": "2021-10-01T16:42:46-04:00",
26
"template_suffix": null,
27
"tags": "Announcing, Mystery",
28
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
29
}
30
]
31
}

Examples

Was this section helpful?
get
/admin/api/2021-10/blogs.json
Copy
            
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
1
HTTP/1.1 200 OK
2
{
3
"blogs": [
4
{
5
"id": 382285388,
6
"handle": "banana-blog",
7
"title": "A Gnu Blog",
8
"updated_at": "2006-02-02T19:00:00-05:00",
9
"commentable": "no",
10
"feedburner": null,
11
"feedburner_location": null,
12
"created_at": "2021-10-01T16:42:46-04:00",
13
"template_suffix": null,
14
"tags": "",
15
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"
16
},
17
{
18
"id": 241253187,
19
"handle": "apple-blog",
20
"title": "Mah Blog",
21
"updated_at": "2006-02-01T19:00:00-05:00",
22
"commentable": "no",
23
"feedburner": null,
24
"feedburner_location": null,
25
"created_at": "2021-10-01T16:42:46-04:00",
26
"template_suffix": null,
27
"tags": "Announcing, Mystery",
28
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
29
}
30
]
31
}

get
Receive a single Blog

Get a single blog by its ID

Parameters


api_version
string
required

blog_id
string
required

fields
comma-separated list of fields to include in the response
Was this section helpful?
get
/admin/api/2021-10/blogs/241253187.json
Copy
        
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{
3
"blog": {
4
"id": 241253187,
5
"handle": "apple-blog",
6
"title": "Mah Blog",
7
"updated_at": "2006-02-01T19:00:00-05:00",
8
"commentable": "no",
9
"feedburner": null,
10
"feedburner_location": null,
11
"created_at": "2021-10-01T16:42:46-04:00",
12
"template_suffix": null,
13
"tags": "Announcing, Mystery",
14
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
15
}
16
}

Examples

Was this section helpful?
get
/admin/api/2021-10/blogs/241253187.json
Copy
        
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{
3
"blog": {
4
"id": 241253187,
5
"handle": "apple-blog",
6
"title": "Mah Blog",
7
"updated_at": "2006-02-01T19:00:00-05:00",
8
"commentable": "no",
9
"feedburner": null,
10
"feedburner_location": null,
11
"created_at": "2021-10-01T16:42:46-04:00",
12
"template_suffix": null,
13
"tags": "Announcing, Mystery",
14
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
15
}
16
}

get
Receive a count of all Blogs

Get a count of all blogs

Parameters


api_version
string
required
Was this section helpful?
get
/admin/api/2021-10/blogs/count.json
Copy
        
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/count.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{
3
"count": 2
4
}

Examples

Was this section helpful?
get
/admin/api/2021-10/blogs/count.json
Copy
        
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/count.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{
3
"count": 2
4
}

put
Modify an existing Blog

Update a blog

Parameters


api_version
string
required

blog_id
string
required
Was this section helpful?
put
/admin/api/2021-10/blogs/241253187.json
Copy
        
curl -d '{"blog":{"id":241253187,"title":"IPod Updates"}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{
3
"blog": {
4
"title": "IPod Updates",
5
"handle": "apple-blog",
6
"id": 241253187,
7
"updated_at": "2021-10-01T16:45:37-04:00",
8
"commentable": "no",
9
"feedburner": null,
10
"feedburner_location": null,
11
"created_at": "2021-10-01T16:42:46-04:00",
12
"template_suffix": null,
13
"tags": "Announcing, Mystery",
14
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
15
}
16
}

Examples

Was this section helpful?
put
/admin/api/2021-10/blogs/241253187.json
Copy
        
curl -d '{"blog":{"id":241253187,"title":"IPod Updates"}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{
3
"blog": {
4
"title": "IPod Updates",
5
"handle": "apple-blog",
6
"id": 241253187,
7
"updated_at": "2021-10-01T16:45:37-04:00",
8
"commentable": "no",
9
"feedburner": null,
10
"feedburner_location": null,
11
"created_at": "2021-10-01T16:42:46-04:00",
12
"template_suffix": null,
13
"tags": "Announcing, Mystery",
14
"admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
15
}
16
}

del
Remove an existing Blog

Delete a blog

Parameters


api_version
string
required

blog_id
string
required
Was this section helpful?
del
/admin/api/2021-10/blogs/241253187.json
Copy
        
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{}

Examples

Was this section helpful?
del
/admin/api/2021-10/blogs/241253187.json
Copy
        
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}
Response
JSON
        
1
HTTP/1.1 200 OK
2
{}