# Dev.to Scraper - Articles & Developer Content (`pear_fight/devto-scraper`) Actor

Scrape Dev.to articles, author profiles, tags & comments. Extract titles, content, reactions, reading time, dates. Search by topic, tag, or author. Track developer trends. Pay per result. Export JSON/CSV.

- **URL**: https://apify.com/pear\_fight/devto-scraper.md
- **Developed by:** [Harald](https://apify.com/pear_fight) (community)
- **Categories:** News
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## DEV.to Scraper ⚡

Fast and reliable DEV.to article scraper that uses the **official DEV.to API**. Extract articles, user information, tags, reactions, and comments without browser overhead.

### Why This Scraper?

- ⚡ **Super Fast** - Uses official API, no browser needed
- 💰 **Cost Efficient** - HTTP requests only, minimal compute units
- 🎯 **Reliable** - Official API means no breakage from UI changes
- 🔍 **Flexible Filters** - Search by username, tag, keywords, or get top articles
- 📊 **Rich Data** - Get reactions, comments, user profiles, tags, and more

### Features

✅ Scrape articles by **username** (e.g., all posts from @ben)  
✅ Filter by **tag** (e.g., #javascript, #python, #webdev)  
✅ **Search within articles** (title, description, tags)  
✅ Get **top articles** by day/week/month/year  
✅ Extract **comments** (optional)  
✅ Get **user profiles** with social links  
✅ Fetch **organization** information  
✅ Sort by **fresh** or **rising** articles  

### Use Cases

- 📈 **Content Research** - Find trending topics and popular articles
- 🎯 **Competitor Analysis** - Track what successful developers write about
- 📚 **Content Curation** - Build reading lists or newsletters
- 🤖 **AI Training Data** - Collect developer content for LLMs
- 📊 **Analytics** - Track engagement metrics (reactions, comments)
- 🔔 **Monitoring** - Watch for articles with specific keywords/tags

### Input Configuration

#### Basic Filters

- **Username** - Get articles from a specific user (e.g., `ben`, `jess`)
- **Tag** - Filter by tag (e.g., `javascript`, `webdev`, `tutorial`)
- **Search Query** - Search within titles, descriptions, and tags
- **Max Articles** - Limit results (default: 100)

#### Advanced Options

- **Top N** - Get top articles (7=week, 30=month, 365=year, 999=all-time)
- **State** - Choose `fresh` (recent), `rising` (trending), or `all`
- **Include Comments** - Fetch comments for each article (increases runtime)

### Output Data

Each article includes:

```json
{
  "id": 3265532,
  "title": "A New Chapter: DEV is Joining Forces with MLH",
  "description": "Hey everyone, I have some massive news...",
  "url": "https://dev.to/devteam/...",
  "publishedAt": "2026-02-18T14:10:31Z",
  "commentsCount": 86,
  "publicReactionsCount": 343,
  "readingTimeMinutes": 6,
  "tags": ["news", "devto", "hackathon", "discuss"],
  "coverImage": "https://...",
  "user": {
    "name": "Ben Halpern",
    "username": "ben",
    "twitterUsername": "bendhalpern",
    "githubUsername": "benhalpern",
    "websiteUrl": "http://benhalpern.com",
    "profileImage": "https://..."
  },
  "organization": {
    "name": "The DEV Team",
    "username": "devteam"
  }
}
````

### Examples

#### Get Recent JavaScript Articles

```json
{
  "tag": "javascript",
  "maxArticles": 50
}
```

#### Get All Posts from a User

```json
{
  "username": "ben",
  "maxArticles": 200
}
```

#### Find Articles About React Hooks

```json
{
  "searchQuery": "react hooks",
  "maxArticles": 100
}
```

#### Get Top Weekly Articles

```json
{
  "top": 7,
  "maxArticles": 50
}
```

#### Get Trending Python Articles with Comments

```json
{
  "tag": "python",
  "state": "rising",
  "includeComments": true,
  "maxArticles": 30
}
```

### API Limits & Best Practices

- The DEV.to API is rate-limited but generous for reasonable use
- This scraper includes automatic 500ms delays between pages
- Fetching comments increases runtime - use only when needed
- Start with small `maxArticles` values to test your filters

### Cost

This actor is extremely cheap to run because it uses simple HTTP requests instead of browsers:

- \~0.001 compute units per 100 articles (without comments)
- \~0.01 compute units per 100 articles (with comments)

### Support

- 📖 [DEV.to API Documentation](https://developers.forem.com/api)
- 💬 Questions? Open an issue or contact the developer
- ⭐ Like this actor? Leave a review!

### License

Apache-2.0

# Actor input Schema

## `username` (type: `string`):

Filter articles by DEV.to username (e.g., 'ben' or 'jess'). Leave empty for all users.

## `tag` (type: `string`):

Filter articles by tag (e.g., 'javascript', 'python', 'webdev'). Leave empty for all tags.

## `searchQuery` (type: `string`):

Search within article titles, descriptions, and tags. Case-insensitive. Leave empty to skip filtering.

## `top` (type: `integer`):

Get top N articles. Use values like 7 (week), 30 (month), 365 (year), or 999 (all time). Leave empty for recent articles.

## `state` (type: `string`):

Article state filter. 'fresh' = recent articles, 'rising' = trending articles, 'all' = all articles.

## `maxArticles` (type: `integer`):

Maximum number of articles to scrape.

## `includeComments` (type: `boolean`):

Fetch comments for each article. Warning: This will increase runtime and cost.

## Actor input object example

```json
{
  "username": "ben",
  "tag": "javascript",
  "searchQuery": "react hooks",
  "top": 7,
  "state": "fresh",
  "maxArticles": 100,
  "includeComments": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("pear_fight/devto-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("pear_fight/devto-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call pear_fight/devto-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pear_fight/devto-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Dev.to Scraper - Articles & Developer Content",
        "description": "Scrape Dev.to articles, author profiles, tags & comments. Extract titles, content, reactions, reading time, dates. Search by topic, tag, or author. Track developer trends. Pay per result. Export JSON/CSV.",
        "version": "1.0",
        "x-build-id": "sBQwBEzKDrtysiUO5"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pear_fight~devto-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pear_fight-devto-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/pear_fight~devto-scraper/runs": {
            "post": {
                "operationId": "runs-sync-pear_fight-devto-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/pear_fight~devto-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-pear_fight-devto-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "username": {
                        "title": "Username",
                        "type": "string",
                        "description": "Filter articles by DEV.to username (e.g., 'ben' or 'jess'). Leave empty for all users."
                    },
                    "tag": {
                        "title": "Tag",
                        "type": "string",
                        "description": "Filter articles by tag (e.g., 'javascript', 'python', 'webdev'). Leave empty for all tags."
                    },
                    "searchQuery": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Search within article titles, descriptions, and tags. Case-insensitive. Leave empty to skip filtering."
                    },
                    "top": {
                        "title": "Top N Articles",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Get top N articles. Use values like 7 (week), 30 (month), 365 (year), or 999 (all time). Leave empty for recent articles."
                    },
                    "state": {
                        "title": "State",
                        "enum": [
                            "fresh",
                            "rising",
                            "all"
                        ],
                        "type": "string",
                        "description": "Article state filter. 'fresh' = recent articles, 'rising' = trending articles, 'all' = all articles.",
                        "default": "fresh"
                    },
                    "maxArticles": {
                        "title": "Max Articles",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of articles to scrape.",
                        "default": 100
                    },
                    "includeComments": {
                        "title": "Include Comments",
                        "type": "boolean",
                        "description": "Fetch comments for each article. Warning: This will increase runtime and cost.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
