Dev.to's Hidden API: Automating Article Publishing Without API Keys
Dev.to has a well-documented REST API that requires an API key from your settings page. But did you know there's a simpler way to automate publishing — one that doesn't require any API key at all?
The Form-Based Approach
Dev.to, being built on Ruby on Rails, uses traditional form-based submissions with CSRF protection. This means you can publish articles by simply sending POST requests with the right tokens — no API key needed.
Step 1: Login
import requests, re
session = requests.Session()
login_page = session.get('https://dev.to/enter')
csrf = re.search(
r'authenticity_token.*?value="([^"]+)"',
login_page.text
).group(1)
session.post('https://dev.to/users/sign_in', data={
'user[email]': 'your@email.com',
'user[password]': 'your-password',
'authenticity_token': csrf,
'user[remember_me]': '1',
})
Step 2: Get Publishing Token
The same CSRF mechanism works for article creation. The token from the dashboard page is valid for all form submissions:
dashboard = session.get('https://dev.to/dashboard')
csrf = re.search(
r'authenticity_token.*?value="([^"]+)"',
dashboard.text
).group(1)
Step 3: Publish
session.post('https://dev.to/articles', data={
'authenticity_token': csrf,
'article[title]': 'Your Title',
'article[body_markdown]': open('article.md').read(),
'article[tags]': 'python,devto',
'article[published]': '1',
})
That's it. Three steps, no API key, no OAuth, no JavaScript rendering.
Why This Matters
This approach is useful for:
- CI/CD pipelines — Auto-publish release notes to Dev.to
- Cross-posting — Mirror content from your blog to Dev.to
- Batch publishing — Publish article series in one go
- Static site generators — Hook your SSG build output directly to Dev.to
Important Notes
- Rate limit: ~1 article per 30 seconds
-
Session expiry: Sessions last 2-4 weeks with
remember_me - Tags: Max 4 tags per article, no spaces in tag names
- Content: Standard markdown with Dev.to's extended syntax
Get the Complete Tool
I've packaged everything into a ready-to-use tool with error handling, session management, and batch processing.
$15 USDT (TRC-20) — One purchase, use forever.
TNeUMpbwWFcv6v7tYHmkFkE7gC5eWzqbrs
Full package details: https://telegra.ph/Devto-Batch-Publisher--15-USDT-One-Time-Purchase-04-29
Questions? Drop a comment or reach out on Telegram (@tianka_ai).
Top comments (0)