# 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
- **Stats:** 220 total users, 1 monthly users, 0.0% runs succeeded, 4 bookmarks
- **User rating**: 3.00 out of 5 stars

## Pricing

$20.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

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

## 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: "garyvee")
-   📈 **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": "garyvee",
  "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("💾 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 qpayre/medium-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Medium Scraper",
        "description": "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.",
        "version": "0.2",
        "x-build-id": "QQU4bYnHDuBAAOazm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/qpayre~medium-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-qpayre-medium-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/qpayre~medium-scraper/runs": {
            "post": {
                "operationId": "runs-sync-qpayre-medium-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/qpayre~medium-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-qpayre-medium-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",
                "required": [
                    "author",
                    "limit"
                ],
                "properties": {
                    "author": {
                        "title": "Author name",
                        "type": "string",
                        "description": "The medium's author name.",
                        "default": "garyvee"
                    },
                    "limit": {
                        "title": "Limit number of posts",
                        "type": "integer",
                        "description": "The number of posts to retrieve. Get the latest <limit> posts",
                        "default": 25
                    },
                    "article_content": {
                        "title": "Article content",
                        "type": "boolean",
                        "description": "Include parsed article content in the results.",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
