Post → Get
AI-generatedOverview
This node integrates with the Ghost CMS API (version 2) to manage blog posts, images, and media with enhanced features. Specifically for the Post - Get operation, it retrieves a single post from Ghost either by its ID or slug. The data source can be chosen between the Content API or the Admin API, allowing flexibility depending on the user's access level and required data.
Common scenarios where this node is beneficial include:
- Fetching detailed information about a specific blog post for display or processing.
- Integrating Ghost content into other systems or workflows by retrieving posts dynamically.
- Using either public-facing content data (Content API) or more privileged admin-level data (Admin API).
Practical example:
- A marketing automation workflow that pulls the latest blog post by slug from Ghost's Content API to share on social media.
- An editorial dashboard that fetches post details via the Admin API for review or updates.
Properties
| Name | Meaning |
|---|---|
| Source | Choose the API source: Admin API or Content API. |
| By | Select how to identify the post: by ID or by Slug. |
| Identifier | The actual ID or slug string used to find the post. |
| Options | Additional request options: |
| - Fields: Comma-separated list of fields to return (string). | |
| - Formats: Output formats for the post content. | |
- For Content API: html, plaintext (default: html). |
|
- For Admin API: html, mobiledoc (default: mobiledoc). |
Output
The output is an array of JSON objects representing the retrieved post(s). Each object corresponds to a post and contains all the fields returned by the Ghost API according to the selected options.
- The main output field is
json, which includes the post data such as title, slug, content in requested format(s), metadata, and other post attributes. - No binary data is output for this operation.
Example output snippet (simplified):
[
{
"id": "5f8d0d55b54764421b7156c1",
"title": "My Blog Post",
"slug": "my-blog-post",
"html": "<p>Post content here</p>",
"plaintext": "Post content here",
"published_at": "2023-01-01T12:00:00Z",
...
}
]
Dependencies
- Requires valid credentials for either the Ghost Content API or Admin API.
- The node uses internal helper functions to make authenticated HTTP requests to Ghost endpoints.
- Timezone handling depends on the
moment-timezonelibrary bundled with the node. - No additional external services are needed beyond Ghost CMS itself.
Troubleshooting
Error: "Content must be a valid JSON"
Occurs if content provided for certain operations (not relevant for Get but for Create/Update) is invalid JSON. Ensure JSON strings are well-formed.Error when using slug or ID
If the post is not found, the API may return an error or empty result. Verify the identifier is correct and matches the selected "By" option.Authentication errors
Make sure the API key credential is correctly configured and has sufficient permissions for the chosen source (Content or Admin API).Empty results
Check the "Fields" and "Formats" options; requesting unsupported fields or formats might lead to missing data.