Dev.to API via curl. Use this skill to publish and manage articles on Dev.to.
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
Use the Dev.to API via direct curl calls to publish and manage articles.
Official docs:
https://developers.forem.com/api/v1
Use this skill when you need to:
export DEVTO_API_KEY="your-api-key"
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
All examples below assume you have DEVTO_API_KEY set.
bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "My Awesome Article",
"body_markdown": "## Introduction\n\nThis is my article content.\n\n## Conclusion\n\nThanks for reading!",
"published": false,
"tags": ["javascript", "webdev"]
}
}'"'"' | jq '"'"'{id, url, published}'"'"''
Response:
{
"id": 123456,
"url": "https://dev.to/username/my-awesome-article-abc",
"published": false
}
Set published: true to publish right away:
bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "Published Article",
"body_markdown": "Content here...",
"published": true,
"tags": ["tutorial"]
}
}'"'"' | jq '"'"'{id, url, published}'"'"''
bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "Article with Cover",
"body_markdown": "Content here...",
"published": true,
"tags": ["webdev", "tutorial"],
"main_image": "https://example.com/cover.png"
}
}'"'"' | jq '"'"'{id, url}'"'"''
TITLE="My Article Title"
CONTENT=$(cat article.md | jq -Rs '.')
curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d "{
\"article\": {
\"title\": \"${TITLE}\",
\"body_markdown\": ${CONTENT},
\"published\": false,
\"tags\": [\"programming\"]
}
}" | jq '{id, url, published}'
bash -c 'curl -s "https://dev.to/api/articles/me?per_page=10" -H "api-key: ${DEVTO_API_KEY}"' | jq '.[] | {id, title, published, url}'
bash -c 'curl -s "https://dev.to/api/articles/me/published?per_page=10" -H "api-key: ${DEVTO_API_KEY}"' | jq '.[] | {id, title, url}'
bash -c 'curl -s "https://dev.to/api/articles/me/unpublished" -H "api-key: ${DEVTO_API_KEY}"' | jq '.[] | {id, title}'
Note: Replace
123456with an actual article ID from the "List My Articles" response (example 5) or from theidfield in the create article response (example 1).
ARTICLE_ID="123456"
bash -c 'curl -s "https://dev.to/api/articles/${ARTICLE_ID}" -H "api-key: ${DEVTO_API_KEY}"' | jq '{id, title, url, published}'
Note: Replace
123456with an actual article ID from the "List My Articles" response (example 5) or from theidfield in the create article response (example 1).
ARTICLE_ID="123456"
bash -c 'curl -s -X PUT "https://dev.to/api/articles/${ARTICLE_ID}" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "Updated Title",
"body_markdown": "Updated content..."
}
}'"'"' | jq '"'"'{id, url}'"'"''
Note: Replace
123456with an actual article ID from the "List My Articles" response (example 5) or from theidfield in the create article response (example 1).
ARTICLE_ID="123456"
bash -c 'curl -s -X PUT "https://dev.to/api/articles/${ARTICLE_ID}" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"published": true
}
}'"'"' | jq '"'"'{id, url, published}'"'"''
| Parameter | Type | Description |
|---|---|---|
title | string | Article title (required) |
body_markdown | string | Content in Markdown |
published | boolean | true to publish, false for draft |
tags | array | Up to 4 tags (lowercase, no spaces) |
main_image | string | Cover image URL |
canonical_url | string | Original article URL (for cross-posts) |
series | string | Series name to group articles |
bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "Getting Started with Docker",
"body_markdown": "## What is Docker?\n\nDocker is a platform for developing...\n\n## Installation\n\n```bash\nbrew install docker\n```\n\n## Your First Container\n\n```bash\ndocker run hello-world\n```",
"published": true,
"tags": ["docker", "devops", "tutorial", "beginners"]
}
}'"'"' | jq '"'"'{url}'"'"''
bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "My Blog Post",
"body_markdown": "Content from my blog...",
"published": true,
"canonical_url": "https://myblog.com/original-post",
"tags": ["webdev"]
}
}'"'"' | jq '"'"'{url}'"'"''
bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d '"'"'{
"article": {
"title": "React Hooks - Part 1: useState",
"body_markdown": "First part of the series...",
"published": true,
"series": "React Hooks Deep Dive",
"tags": ["react", "javascript", "hooks"]
}
}'"'"' | jq '"'"'{url}'"'"''
jq -Rs to properly escape markdown contentpublished: false to review before publishing