# Medium Scraper (`qpayre/medium-scraper`) Actor

Revolutionize your content sourcing with Medium Author Scraper - the powerful Apify actor that effortlessly scrapes all posts / contents from your desired Medium author and returns the data in a structured format, giving you valuable insights in just seconds.

- **URL**: https://apify.com/qpayre/medium-scraper.md
- **Developed by:** [QPS](https://apify.com/qpayre) (community)
- **Categories:** Automation, News
- **Features:** Limited permissions
- **Stats:** 219 total users, 1 monthly users, 63.8% runs succeeded, 4 bookmarks
- **User rating**: 3.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Medium Author Scraper

![image](https://drive.google.com/uc?export=view\&id=1C9fCAGGn-x9xJkgJblYALJQFRKOP2DwO)

Medium Author Scraper is an Apify actor designed to scrape all posts from a specified Medium author and retrieve the content of each article. The actor returns the data in a structured format, as a list of dictionaries, making it easy to analyze and process the information further.

### Features

- 📝 Scrape all posts from a specified Medium author.
- 📄 Retrieve each article's content.
- 📊 Results are provided in a structured format (list of dictionaries).
- ⚙️ Customizable options to limit the number of posts and include or exclude article content in the results.

### Input

The actor accepts the following input properties:

- 📝 **Author name**: The name of the Medium author whose posts you want to scrape. (Default: "michaellim-co")
- 📈 **Limit number of posts**: The number of posts to retrieve. This will get the latest 'n' posts, where 'n' is the specified limit. (Default: 25)
- 📄 **Article content**: A boolean flag to include or exclude the parsed article content in the results. (Default: false)

### Output

The actor will return a JSON array containing information about each scraped post. Each entry in the array will be a dictionary containing the following keys:

- 📝 **title**: The title of the post.
- 🔗 **url**: The URL of the post.
- 🙎 **author**: The author's name.
- 🔗 **author_url**: The URL of the author's Medium profile.
- 📅 **published_at**: The publication date and time of the post.

If the "Article content" input property is set to `true`, each entry will also include the following key:

- 📝 **body**: A list of content objects representing the structure of the article. Each content object will contain the following keys:
  - 📌 **content_type**: The type of content (e.g., "h" for heading, "p" for paragraph, "img" for image, "a" for link).
  - 🔗 **src**: The source URL for images, videos, or links (optional).
  - 🆔 **level**: The heading level for headings (optional).
  - 📝 **content**: The content of headings and paragraphs (optional).

Example :

```json
[{
  "title": "Addressing Fake GaryVee Accounts and Scams",
  "url": "https://medium.com/@garyvee/addressing-fake-garyvee-accounts-and-scams-86ae0e773780",
  "author": "garyvee",
  "author_url": "https://garyvee.medium.com",
  "published_at": "2022-01-21 21:12:38.624000"
},
{
  "title": "Gary Vaynerchuk’s Actual Thoughts On Hustle (Told Through Memes)",
  "url": "https://medium.com/swlh/gary-vaynerchuks-actual-thoughts-on-hustle-told-through-memes-4992dc9ce616",
  "author": "garyvee",
  "author_url": "https://garyvee.medium.com",
  "published_at": "2018-12-16 11:47:58.703000"
},
{
  "title": "A Message For Those Feeling Lost In Their 20s",
  "url": "https://medium.com/@garyvee/a-message-for-those-feeling-lost-in-their-20s-278a878baac2",
  "author": "garyvee",
  "author_url": "https://garyvee.medium.com",
  "published_at": "2018-12-12 15:24:50.375000"
}]
```

![image](https://drive.google.com/uc?export=view\&id=1Q3VNv31AXfZ7pVqf_vEC2zdtMqiuRV52)

### Usage

To use this actor, simply provide the required input properties and run the actor. You can customize the input properties to limit the number of posts or include/exclude the article content in the results as needed.

Once the actor has completed its run, the scraped data will be available in the specified output format, making it easy to analyze, process, or store the information for further use.

### Contact us ?

Any project or questions ?

quentin.payre.entreprise@gmail.com
Telegram @quentinpjf

# Actor input Schema

## `author` (type: `string`):

The medium's author name.

## `limit` (type: `integer`):

The number of posts to retrieve. Get the latest <limit> posts

## `article_content` (type: `boolean`):

Include parsed article content in the results.

## Actor input object example

```json
{
  "author": "michaellim-co",
  "limit": 25,
  "article_content": 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("qpayre/medium-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("qpayre/medium-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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 qpayre/medium-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,qpayre/medium-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fNGr1uhPkX9IcMyqY/builds/aw7bc7CKqmj6Yw6am/openapi.json
