Installation
- Bundler (Gemfile)
- gem install
Add to your Gemfile:Then run:
Initialization
Configure the SDK with your Read API token from the ButterCMS Settings.Configuration options
| Option | Type | Default | Description |
|---|---|---|---|
api_token | String | - | Your ButterCMS Read API token (required) |
test_mode | Boolean | false | Enable preview mode for draft content |
read_timeout | Float | 5.0 | Read timeout in seconds |
open_timeout | Float | 2.0 | Connection open timeout in seconds |
API methods
Pages
Retrieve and search pages created in the ButterCMS dashboard.Collections
Fetch content from Collections (structured data tables).Blog Posts
Access the built-in Blog Engine for posts, categories, tags, and authors.Authors
Categories
Tags
Feeds
Retrieve RSS, Atom, and Sitemap feeds.Query parameters reference
| Parameter | Applies To | Description |
|---|---|---|
page | Posts, Pages | Page number for pagination |
page_size | Posts, Pages | Number of items per page |
exclude_body | Posts | Exclude post body for faster response |
author_slug | Posts | Filter posts by author |
category_slug | Posts | Filter posts by category |
tag_slug | Posts | Filter posts by tag |
include | Authors, Categories, Tags | Include recent_posts with response |
locale | Pages, Collections | Locale code for localized content |
preview | Pages | Set to 1 to include draft content |
levels | Pages | Depth of nested references (1–3) |
Complete example
Resources
GitHub Repository
View source code, report issues, and contribute
RubyGems
Package details and version history