How to publish posts via the dev.to API
Web page · https://juliecodestack.github.io/2026/10/21/publish_via_devto_api
Every time I copied a post into the dev.to editor, added tags and cleaned up the formatting, I'd...
First seen by Oriel on .
AI summary
The article explains how to publish Markdown posts to dev.to through its API, showing a direct curl request and a reusable Python script that reads front matter.
- The curl example creates a draft by default; setting `published` to true publishes it immediately.
- The Python script uses `requests` and `python-frontmatter` to send a post’s title, body, and tags, with the API key loaded from `DEVTO_API_KEY`.
- dev.to accepts at most four tags per post, and `canonical_url` can identify the original post on another blog.
- Local image paths will not work; images must use public URLs, which dev.to fetches and stores as copies.
- The article recommends keeping the API key in an environment variable and out of public repositories.
#dev.to api #python #markdown #content publishing
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Reactions
Total public reactions reported by the source; distinct from points and likes.
- DEV Community: 38, latest observation ; +30 over observed period since
Comments
Comment count reported by the source.
- DEV Community: 15, latest observation ; +14 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| DEV Community | 4886799 | https://juliecodestack.github.io/2026/10/21/publish_via_devto_api/ Read discussion |