Flexible Blog Post JSON Feed Documentation

Use this template to output a JSON feed containing blog posts. Both the JSON and the sorting and filtering of blog posts are easily customized so that you return exactly the data that you need. See a sample feed and play around with query parameters with our sample blog feed.

Customize JSON fields

Easily customize the fields to output in your JSON feed in the page (article) that you create.

Sample Configuration - Optional Blog Post Fields to Show

Options for blog post fields include guid, name, post_date, url, summary, content, blog, image, tags, authors, folder, and more.

Tags, authors, folder, image, and blog may either be output as objects or as strings.

For tags, authors, and blogs, the string that is output would be the title (eg: "Company News"). For folders the string that is output would be the path (eg: "/blog/corporate/archived"). For images the string that is output would be the "path" (image URL) (eg: "https://images.marketpath.com/path/to/image.jpg").

In each of these cases, if outputting an object, you may further define which fields you would like to show, similar to when outputting the original blog posts.


Output Blog Post Custom Fields

You may optionally output addtiional blog post fields by selecting the "other" field and filling out the "Other Fields to Show" field. This may be useful if you want to return information from custom fields on blog posts - such as when using a blog for a project portfolio or some other extended use case.


Use Image Presets

Simply enter one or more image presets to use and the image URLs output in the JSON feed will use those presets. If outputting images as objects, the preset will be used for the URL in the "preset" property - the "path" property will still include the URL of the original image.


Customize how blog posts are pulled

Easily customize which blog posts are pulled, and in what order, using HTTP query parameters.

Available query parameters are:

start_date
The post_date of the earliest blog post to fetch
end_date
The post_date of the latest blog post to fetch
blog
The blog to fetch posts from. May either be the blog name or the guid (note that using the blog title my produce different results than anticipated).
tag
The tag to filter blog posts by. May either be the tag name or the guid (note that using the tag title my produce different results than anticipated).
author
The author to filter blog posts by. May either be the author name or the guid (note that using the author title my produce different results than anticipated).
folder
The folder to filter blog posts by. May either be the folder path or the guid (note that the path uses folder names, not titles).
filter
An optional string to filter blog posts by. Less common but may be used to search blog posts for specific terms.
has_url
Include has_url=true to only return blog posts that have URLs or has_url=false to only return blog posts that do not have URLs.
include_in_search
Only applies if has_url=true is set. Include include_in_search=true to only return blog posts with URLs that should be included in search results or include_in_search=false to only return blog posts with URLs that should NOT be included in search results.
limit
The number of blog posts to return
page
In paginated results, this is the page number of results to return (eg: if there are 25 blog posts that match the filters and limit is 10, include page=2 to return results 11-20 and page=3 to return results 21-25).
oldest
Include oldest=true to return the oldest blog posts first (by post_date). Otherwise blog posts will be sorted by newest first.

Accessing Pagination Information

Pagination information is returned in custom HTTP headers:

X-Pagination-Total
The total number of blog posts that match the provided filters
X-Pagination-Pages
The number of paginated pages that match the provided filters (eg: if there are 30 posts returned 10 at a time then there are 3 pages of results)
X-Pagination-Page
The paginated page of results returned. This should typically match the page query parameter if provided, or 1 if not provided.
X-Pagination-Limit
The maximum number of blog posts returned per page
X-Pagination-Start
The row number of the first blog post returned
X-Pagination-End
The row number of the last blog post returned (will be the same as X-Pagination-Start if no results are returned)
X-Pagination-Size
The number of results returned on the current page. Should always be the same as the length of the JSON array.