# Medium Articles Scraper (`ef12/medium-articles-scraper`) Actor

Scrape Medium articles by tag or author using the public JSON API. Get titles, subtitles, authors, claps, reading time, and tags.

- **URL**: https://apify.com/ef12/medium-articles-scraper.md
- **Developed by:** [Daniel Wilson](https://apify.com/ef12) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## Medium Articles Scraper

### What does Medium Articles Scraper do?

**Medium Articles Scraper** extracts articles from [Medium](https://medium.com) using Medium's public JSON API — no authentication required. Given a **tag** (e.g., "python", "ai", "programming") or an **author username**, it returns structured data for each article: title, URL, author, publication date, reading time, clap count, tags, and a preview snippet.

Unlike browser-based scrapers that load JavaScript and render pages, this Actor uses Medium's internal JSON feed endpoints. By sending an `Accept: application/json` header, Medium returns structured JSON instead of HTML, making the scraper faster, cheaper, and more reliable. Each run delivers clean, pre-formatted data straight to your Apify dataset where you can download it as JSON, CSV, HTML, or Excel — or pipe it into any API-connected tool.

### Why use Medium Articles Scraper?

Medium hosts millions of articles across technology, data science, design, business, self-improvement, and hundreds of other topics. Its recommendations engine surfaces high-quality content daily, but accessing that content at scale — for research, analysis, content curation, or monitoring — requires automation.

**Use cases:**

- **Content curation and newsletters** — Automatically collect trending articles from your niche (e.g., "ai", "blockchain", "startups") every day and build a curated newsletter or digest without manual copy-pasting.
- **Market and competitive intelligence** — Monitor what authors in your industry are publishing. Track article topics, publishing frequency, and engagement (claps) to identify content gaps and understand what resonates with readers.
- **Data science and NLP research** — Gather a corpus of articles by topic for sentiment analysis, topic modeling, trend detection, or training language models. The structured output (title, tags, preview text) gives you clean data to work with.
- **SEO and content strategy** — Analyze which article structures, titles, and topics perform best in your domain. Use the data to inform your own content strategy, identify high-engagement topics, and study successful authors.
- **Academic research** — Collect articles on specific subjects for literature reviews, citation analysis, or sociological studies of online publishing trends.
- **Personal knowledge base** — Archive articles from your favorite authors or tags for offline reading, reference, or personal study.
- **Social media and marketing** — Find trending content in your industry to share on social media, identify influencers (authors with high clap counts), and track content themes over time.

### How to use Medium Articles Scraper

Using this Actor is straightforward. Follow these steps:

1. **Open the Actor** in Apify Console. You'll see the Input tab with a form.
2. **Configure the input:**
   - Enter a **tag** such as "python", "machine-learning", or "design" to fetch trending or latest articles in that topic.
   - Optionally enter a **username** (without the @ symbol) to fetch articles by a specific author.
   - Choose **sort order**: "trending" (top recommended articles) or "newest" (latest published).
   - Set **max results** to limit the number of articles returned (up to 100).
3. **Run the Actor**. The scraper will call Medium's JSON API, parse the response, and push each article as a dataset item.
4. **Download results** from the dataset tab. You can export as JSON, CSV, HTML, or Excel.

You can also run it programmatically via Apify API — useful for scheduled runs or integration into larger data pipelines.

### Input

The Actor accepts the following input parameters. Configure them in the **Input** tab before running.

| Field | Type | Default | Description |
| ------- | ------ | --------- | ------------- |
| `tag` | string | "programming" | Medium tag to search (e.g., "python", "ai", "javascript"). Optional if username is provided. |
| `username` | string | — | Medium username to fetch articles by a specific author (without @). Optional if tag is provided. |
| `sort` | string | "trending" | Sort order: "trending" (recommended) or "newest" (latest). |
| `max_results` | integer | 25 | Maximum articles to return (1–100). |

### Output

Each article is stored as an item in the default dataset. Here's an example of a single result:

```json
{
  "title": "10 Python Libraries Every Developer Should Know",
  "url": "https://medium.com/@pythoncoder/10-python-libraries-every-developer-should-know-abc123def456",
  "subtitle": "A curated list of essential Python libraries for 2025",
  "author": "Python Coder",
  "author_url": "https://medium.com/@pythoncoder",
  "published_at": "2025-06-15T08:30:00+00:00",
  "reading_time_minutes": 8,
  "claps": 1420,
  "tags": ["python", "programming", "data-science"],
  "preview_text": "A curated list of essential Python libraries for 2025"
}
````

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel from the **Dataset** tab after each run.

### Data table

| Field | Type | Description |
| ------- | ------ | ------------- |
| `title` | string | Article title |
| `url` | string | Full medium.com URL |
| `subtitle` | string | null | Subtitle or brief description |
| `author` | string | Author's display name |
| `author_url` | string | Link to author's Medium profile |
| `published_at` | string | ISO 8601 publication timestamp |
| `reading_time_minutes` | integer | Estimated reading time in minutes |
| `claps` | integer | null | Number of claps (likes) |
| `tags` | array of strings | Article tags/categories |
| `preview_text` | string | First 200 characters of the subtitle |

### Pricing / Cost estimation

This Actor uses **Pay Per Event (PPE)** pricing:

- **First 10 results per run are free.** No charge.
- **Beyond 10 results, each additional result costs $0.003** (charged via `apify-actor-start` and `result` events).
- **Starting a run costs $0.00005** (apify-actor-start event).

A typical run with 25 articles would cost approximately $0.00005 (start) + 15 × $0.003 (15 chargeable results) = **$0.045**. For 100 articles: $0.00005 + 90 × $0.003 = **$0.27**.

### Tips and Advanced options

- **Use specific tags** for better results. "machine-learning" returns more focused articles than "ML" or "AI".
- **Keep max\_results at 25 or lower** for quick exploratory runs, then increase for production batch runs.
- **Combine with other Apify Actors** — pipe the output dataset into an NLP Actor for text analysis, or into a Google Sheets integration for live dashboards.
- **Schedule regular runs** via Apify Console to monitor trending content in your niche daily.

### FAQ, disclaimers, and support

**Q: Is authentication required?**\
No. This Actor uses Medium's public JSON endpoints which do not require API keys or login.

**Q: Can I scrape paywalled article content?**\
This Actor extracts metadata only — title, URL, author, claps, etc. It does not bypass paywalls or extract full article text behind the paywall.

**Q: Is this against Medium's Terms of Service?**\
This Actor accesses publicly available data from Medium's public feeds. You should review Medium's Terms of Service and use the tool responsibly. Do not republish scraped content without permission.

**Q: Why use JSON API instead of a browser?**\
Medium returns JSON data when you set `Accept: application/json` on certain URLs. This is significantly faster and cheaper than running a full browser (Playwright/Puppeteer) — no JavaScript rendering overhead, no memory spikes, and no complex selector maintenance.

**Known limitations:**

- Medium may rate-limit requests from certain IP ranges. Running on Apify's platform with proxy rotation provides the best reliability.
- The JSON API endpoints are not officially documented and may change. This Actor is maintained to adapt to any changes.

**Need help or have feedback?** Open an issue on the [GitHub repository](https://github.com/apify/medium-articles-scraper) or contact the author. Custom scrapers, integrations, and enterprise solutions are also available on request.

# Actor input Schema

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

Medium tag to fetch articles for (e.g., "python", "ai", "programming"). Optional if username is provided.

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

Medium username to fetch articles from a specific author (without @). Optional if tag is provided.

## `sort` (type: `string`):

Sort order — trending (top recommendations) or newest (latest articles).

## `max_results` (type: `integer`):

Maximum number of articles to return (max 100).

## Actor input object example

```json
{
  "tag": "python",
  "sort": "trending",
  "max_results": 25
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "tag": "python",
    "username": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("ef12/medium-articles-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 = {
    "tag": "python",
    "username": "",
}

# Run the Actor and wait for it to finish
run = client.actor("ef12/medium-articles-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 '{
  "tag": "python",
  "username": ""
}' |
apify call ef12/medium-articles-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Medium Articles Scraper",
        "description": "Scrape Medium articles by tag or author using the public JSON API. Get titles, subtitles, authors, claps, reading time, and tags.",
        "version": "0.0",
        "x-build-id": "2b8giE1KBMZeTHgNo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ef12~medium-articles-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ef12-medium-articles-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/ef12~medium-articles-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ef12-medium-articles-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/ef12~medium-articles-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ef12-medium-articles-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": {
                    "tag": {
                        "title": "Tag",
                        "maxLength": 50,
                        "type": "string",
                        "description": "Medium tag to fetch articles for (e.g., \"python\", \"ai\", \"programming\"). Optional if username is provided.",
                        "default": "programming"
                    },
                    "username": {
                        "title": "Username",
                        "maxLength": 100,
                        "type": "string",
                        "description": "Medium username to fetch articles from a specific author (without @). Optional if tag is provided."
                    },
                    "sort": {
                        "title": "Sort Order",
                        "enum": [
                            "trending",
                            "newest"
                        ],
                        "type": "string",
                        "description": "Sort order — trending (top recommendations) or newest (latest articles).",
                        "default": "trending"
                    },
                    "max_results": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of articles to return (max 100).",
                        "default": 25
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
