Loading...
Loading...
Dev.to API via curl. Use this skill to publish and manage articles on Dev.to.
npx skill4agent add vm0-ai/vm0-skills dev.tocurlOfficial docs:https://developers.forem.com/api/v1
export DEVTO_API_KEY="your-api-key"Important: When usingin a command that pipes to another command, wrap the command containing$VARin$VAR. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c '...'bashbash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
DEVTO_API_KEY/tmp/devto_request.json{
"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"]
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{id, url, published}'{
"id": 123456,
"url": "https://dev.to/username/my-awesome-article-abc",
"published": false
}published: true/tmp/devto_request.json{
"article": {
"title": "Published Article",
"body_markdown": "Content here...",
"published": true,
"tags": ["tutorial"]
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{id, url, published}'/tmp/devto_request.json{
"article": {
"title": "Article with Cover",
"body_markdown": "Content here...",
"published": true,
"tags": ["webdev", "tutorial"],
"main_image": "https://example.com/cover.png"
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{id, url}'cat article.md | jq -Rs '.' > /tmp/content.json/tmp/devto_request.json{
"article": {
"title": "My Article Title",
"body_markdown": "Your article content here...",
"published": false,
"tags": ["programming"]
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | 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}'<your-article-id>idbash -c 'curl -s "https://dev.to/api/articles/<your-article-id>" -H "api-key: ${DEVTO_API_KEY}"' | jq '{id, title, url, published}'<your-article-id>id/tmp/devto_request.json{
"article": {
"title": "Updated Title",
"body_markdown": "Updated content..."
}
}bash -c 'curl -s -X PUT "https://dev.to/api/articles/<your-article-id>" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{id, url}'<your-article-id>id/tmp/devto_request.json{
"article": {
"published": true
}
}bash -c 'curl -s -X PUT "https://dev.to/api/articles/<your-article-id>" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{id, url, published}'| Parameter | Type | Description |
|---|---|---|
| string | Article title (required) |
| string | Content in Markdown |
| boolean | |
| array | Up to 4 tags (lowercase, no spaces) |
| string | Cover image URL |
| string | Original article URL (for cross-posts) |
| string | Series name to group articles |
/tmp/devto_request.json{
"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"]
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{url}'/tmp/devto_request.json{
"article": {
"title": "My Blog Post",
"body_markdown": "Content from my blog...",
"published": true,
"canonical_url": "https://myblog.com/original-post",
"tags": ["webdev"]
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{url}'/tmp/devto_request.json{
"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"]
}
}bash -c 'curl -s -X POST "https://dev.to/api/articles" -H "api-key: ${DEVTO_API_KEY}" -H "Content-Type: application/json" -d @/tmp/devto_request.json' | jq '{url}'jq -Rspublished: false