The Complete Guide to Blog APIs: Publish Programmatically
When a blog API is worth having, how the Modern Blogging blog API works with runnable requests, and how it compares with Ghost and WordPress.
A blog API lets a program do what you would otherwise do in the editor: create a post, change it, publish it. This guide explains when that is worth having, how the Modern Blogging blog API works, with requests you can run, and how it compares with the APIs of Ghost and WordPress.
Why blog APIs matter for modern publishing
- Publishing from Git : posts live as Markdown files in a repository and go out when they are merged.
- Migrations : hundreds of posts move in by script instead of by copy and paste.
- Keeping pages current : a job refreshes prices, dates or tables in existing posts.
- AI assistants : an assistant drafts and edits inside the blog instead of handing you text.
- Backups : a scheduled export you control.
If none of these apply, the editor is enough. An API earns its place when a step repeats.
REST API for blog management: what Modern Blogging offers instead
Modern Blogging does not have a REST API. It has one programmatic endpoint that speaks JSON-RPC 2.0, and every action is a named tool you call through it. In practice it is used like any HTTP API: one POST request per action, with a JSON body and a Bearer key.
Value | |
|---|---|
Endpoint | POST https://modernblogging.net/api/mcp |
Format | JSON-RPC 2.0 |
Methods | initialize, tools/list, tools/call |
Tools | 32, covering posts, pages, categories, authors, settings, images, import and export |
Plans | Free and Pro |
MCP (Model Context Protocol) — AI-native blog control
The endpoint follows MCP, an open standard for connecting AI assistants to tools. That is why the same address works for both a script and an assistant: a script sends requests itself, and an assistant such as Claude or Cursor reads the tool list and decides which to call. The MCP blog tool reference covers the assistant side.
Authentication: API keys vs OAuth
API key | OAuth sign-in | |
|---|---|---|
Use it for | Scripts, CI, clients configured by file | AI clients that support sign-in for remote MCP servers |
How you get it | Generate at modernblogging.net/dashboard/api-key | The client opens a browser; you sign in and click Allow |
What you send | Authorization: Bearer mb_... | Nothing by hand; the client stores and renews the token |
Reaches | Every blog you own | Every blog you own |
A key is shown once and can publish to and delete from your blogs. Keep it in a secret store, never in a repository or in client-side code.
Code examples — create, update, publish posts
List the tools
curl -s https://modernblogging.net/api/mcp \
-H "Authorization: Bearer $MB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Create a post
curl -s https://modernblogging.net/api/mcp \
-H "Authorization: Bearer $MB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "create_post",
"arguments": {
"title": "Getting Started with Edge Computing",
"body": "## What edge computing is\n\nEdge computing moves work closer to the reader...",
"excerpt": "A practical introduction to edge computing for web developers.",
"categories": ["Tutorials"],
"seoTitle": "Edge Computing Guide for Web Developers",
"seoDescription": "Learn what edge computing is, when it helps, and how to deploy your first function at the edge, with examples for web developers.",
"focusKeyword": "edge computing",
"publish": false
}
}
}'- title is the only required field. The address is generated from it unless you pass a slug.
- body is Markdown or HTML. Images in it are uploaded to the blog's image storage.
- categories and author take names; a missing one is created.
- publish defaults to false, so the post is saved as a draft.
The result is JSON text inside the response. It contains the post's ID and an SEO score with one line per check. What the checks are .
Update a post
curl -s https://modernblogging.net/api/mcp \
-H "Authorization: Bearer $MB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"update_post","arguments":{"id":"POST_ID","seoDescription":"A clearer description of at least 120 characters, containing the focus keyword edge computing near the start of the sentence."}}}'Fields you leave out stay as they are. The change is saved to the post's draft, so readers see the old version until it is published again.
Publish it
curl -s https://modernblogging.net/api/mcp \
-H "Authorization: Bearer $MB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"publish_post","arguments":{"id":"POST_ID"}}}'unpublish_post returns it to draft and delete_post removes it. For complete scripts in Node.js, see programmatic blog publishing .
Webhooks and cache invalidation
There are no webhooks. Nothing calls your system when a post changes, so a program that needs to know has to ask, for example by calling list_posts on a schedule, or by having the job that publishes also notify whatever depends on it.
Published pages are cached to keep them fast. You do not manage that cache: there is no purge call in the API. Allow for a delay between publishing a change and seeing it on the public page.
Comparing blog APIs: Modern Blogging vs Ghost vs WordPress REST
Modern Blogging | Ghost | WordPress | |
|---|---|---|---|
Style | JSON-RPC tools on one endpoint | REST: a read-only Content API and an Admin API for writes | REST API |
Authentication | API key or OAuth | Content key for reads; signed token for the Admin API | Application passwords or OAuth, depending on the host |
Content format in | Markdown or HTML | Ghost's editor format or HTML | HTML |
SEO feedback in the response | Yes, a score and checks | No | No, unless a plugin adds it |
Webhooks | No | Yes | Through plugins |
AI assistant access (MCP) | Built in, same endpoint | Not part of the core product | Not part of the core software |
Available free | Yes, on the hosted free plan | With self-hosting | With self-hosting; varies on WordPress.com |
Ghost and WordPress have older, larger APIs with more surface: members, comments, media libraries, events. If you need webhooks or those objects, they are the stronger choice. Modern Blogging's API is narrower and aimed at one job, getting well-formed posts into a blog from a script or an assistant, and it tells you about SEO problems in the same response.
Limits
- The free plan allows up to 100 posts and pages and 2 GB of images per blog; Pro allows 1,000 and 20 GB.
- There is no tool that returns one post's full text. list_posts returns titles, addresses, dates, authors, categories and excerpts.
- A key or sign-in only reaches blogs its owner owns.
To try it, create a free blog and generate a key. If you would rather talk to the blog than script it, start with create a blog with AI .
This article was written, styled, and published using the Modern Blogging platform. Launch your own fast, SEO-ready publication in minutes.