Ingest Dev.to Article
Extract the full content of a dev.to article using the public API.
URL Detection
Matches URLs with these patterns:
https://dev.to/{username}/{article-slug}https://dev.to/{username}/{article-slug}-{id}https://www.dev.to/{username}/{article-slug}
Extraction Method
Parse the URL to extract the username and article slug:
- Pattern:
https://dev.to/{username}/{article-slug} - Strip any query parameters or fragments
- Pattern:
Fetch the article via the dev.to public API using the path:
curl -s "https://dev.to/api/articles/{username}/{article-slug}"
This returns a JSON object with the full article content.
Parse JSON response:
title— article titledescription— short description/subtitlebody_markdown— full article content in markdown (this is the primary content)body_html— HTML version (fallback if markdown is insufficient)user.name— author's display nameuser.username— author's dev.to usernamepublished_at— ISO 8601 publish dateedited_at— last edit date (if edited)tags— array of tag stringscanonical_url— canonical URL (may differ if cross-posted)cover_image— cover image URL (if present)positive_reactions_count— total reactionscomments_count— number of commentsreading_time_minutes— estimated read timeurl— the dev.to URL
The
body_markdownfield contains the raw markdown as written by the author, which is the cleanest source. Use this directly as the article content.
Image Handling
After extracting the article content from body_markdown:
Find image URLs in the markdown:
markdown image syntax- dev.to often hosts images at
https://res.cloudinary.com/practicaldev/...orhttps://dev-to-uploads.s3.amazonaws.com/...
Download each image to vault's
raw/assets/:
VAULT="vaults/<vault-name>"
mkdir -p "$VAULT/raw/assets"
# For each image URL:
FILENAME="<article-slug>-img-<NN>.<ext>"
curl -sL -o "$VAULT/raw/assets/$FILENAME" "<image-url>"
- Replace remote URLs with local paths in the raw markdown:
# Before:

# After:

- Download cover image if present:
curl -sL -o "$VAULT/raw/assets/<article-slug>-cover.<ext>" "<cover_image_url>"
- Skip images that are:
- Already local paths
- Tracking pixels or tiny icons (< 1KB)
- Data URIs (base64 embedded)
- dev.to UI elements (avatars, badges, etc.)
Post-Extraction
- Save to vault's
raw/devto-{article-slug}.mdwith YAML header:
---
source-url: <dev.to-url>
title: "<title>"
author: "<name> (@<username>)"
date-fetched: <today>
source-type: article
published: <published_at>
tags: [<tag1>, <tag2>, ...]
reactions: <positive_reactions_count>
comments: <comments_count>
reading-time: <reading_time_minutes>min
canonical-url: "<canonical_url>"
images-downloaded: <count>
---
- Below the frontmatter, include the
body_markdowncontent directly (it's already markdown) - If the article has a cover image, include it at the top of the content
Fallback Chain
- dev.to API by path (best):
curl -s "https://dev.to/api/articles/{username}/{slug}"— returns full markdown, no auth needed - dev.to API search by URL:
curl -s "https://dev.to/api/articles?url=<canonical-url>"— returns array, use first result, then fetch full article by ID:curl -s "https://dev.to/api/articles/{id}" - Web scraping (last resort):
curl -sL "<dev.to-url>"— the article content is in the page HTML within<div id="article-body">. Extract readable content as peringest-webskill.
Dependencies
None — uses only curl.