{
  "openapi": "3.0.1",
  "info": {
    "title": "Medium Scraper - Articles, Claps, Comments, Authors & Full Text",
    "description": "Medium stories by tag (whole archive or Top lists), search, writer, publication, list or link: claps, clappers, responses, reading time, tags, language, member-only flag, writer and publication stats; full text, responses, writer and tag rows. Monitor mode. $0.18 per 1,000 stories, no start fee.",
    "version": "0.1",
    "x-build-id": "w53hpDlGnUsbdSyqH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~medium-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-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/topapi~medium-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-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/topapi~medium-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-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",
        "properties": {
          "tags": {
            "title": "Tags (topics)",
            "type": "array",
            "description": "Medium tags, one per line, as a slug, a name or a link: artificial-intelligence, Machine Learning, https://medium.com/tag/python. Each tag is read the way Tag stories says (default: newest first through the tag's whole archive).",
            "items": {
              "type": "string"
            }
          },
          "tagSort": {
            "title": "Tag stories",
            "enum": [
              "newest",
              "oldest",
              "most-read",
              "hot",
              "new",
              "top-week",
              "top-month",
              "top-year",
              "top-all-time",
              "recommended",
              "all-top"
            ],
            "type": "string",
            "description": "Which stories of each tag. Newest first walks the tag's complete archive back in time (thousands of stories). Oldest first starts at the tag's first story. Most read is Medium's most-read ranking (about 20 a month when a date window is set, otherwise all time). Hot, New and Top week / month / year / all time are Medium's own ranked lists (about 100 each); Recommended is the tag page's recommended feed (300+). All ranked lists merges Hot, the four Top lists and Recommended without duplicates.",
            "default": "newest"
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Medium search, one query per line, e.g. rust async, product-led growth. Search for picks stories, people, publications, tags or lists. Medium answers up to 1,000 stories per query; when more are asked, the query is repeated year by year (newest year first) without duplicates.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "posts",
              "people",
              "publications",
              "tags",
              "lists"
            ],
            "type": "string",
            "description": "What the search terms look for. Stories come back as story rows; people, publications, tags and lists come back as profile rows (followers, bio, description, post count, item count ...).",
            "default": "posts"
          },
          "authors": {
            "title": "Writers",
            "type": "array",
            "description": "Writers as @username, username or profile link (https://medium.com/@ev, https://name.medium.com). Returns every story the writer published, newest first.",
            "items": {
              "type": "string"
            }
          },
          "publications": {
            "title": "Publications",
            "type": "array",
            "description": "Publications as slug, link or own domain: better-programming, https://medium.com/swlh, levelup.gitconnected.com. Returns the publication's stories, newest first.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Medium links",
            "type": "array",
            "description": "Any Medium link, detected automatically: a story (also on a writer subdomain or a publication's own domain), a tag page (/tag/python, /tag/python/top/week), a profile, a publication, a search page (medium.com/search?q=...), a list (/@user/list/name-<id>) or an RSS feed link (/feed/@user, /feed/tag/x). Story IDs (the 12 characters at the end of a story link) work too.",
            "items": {
              "type": "string"
            }
          },
          "urlsFromFile": {
            "title": "Links from a file",
            "type": "string",
            "description": "Optional: the link of a .txt or .csv file (or a Google Sheet shared as 'anyone with the link') listing Medium links or story IDs, one per line or cell."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only stories published on or after this date: 2025-01-01, an ISO time, or relative like 30 days, 6 months, 24 hours. Newest-first tags and writers stop reading at this date, so a daily run reads only what is new."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only stories published on or before this date (same formats). Tags, writers and publications start reading at this date, so a past date range costs no reading of newer stories."
          },
          "minClaps": {
            "title": "Minimum claps",
            "minimum": 0,
            "type": "integer",
            "description": "Leave out stories with fewer claps. 0 = keep all.",
            "default": 0
          },
          "minResponses": {
            "title": "Minimum responses",
            "minimum": 0,
            "type": "integer",
            "description": "Leave out stories with fewer responses (comments). 0 = keep all.",
            "default": 0
          },
          "language": {
            "title": "Languages",
            "type": "string",
            "description": "Keep only stories in these languages (Medium's detected language, ISO codes, comma-separated): en or en, es, pt. Empty = all."
          },
          "memberOnly": {
            "title": "Member-only stories",
            "enum": [
              "all",
              "free",
              "memberOnly"
            ],
            "type": "string",
            "description": "Member-only stories are behind Medium's paywall: their rows carry every field, and the full-text fields hold the public preview any signed-out reader sees. Free only keeps stories whose complete text is public.",
            "default": "all"
          },
          "keywords": {
            "title": "Story contains (any of)",
            "type": "array",
            "description": "Keep stories whose title, subtitle, tags (or text, with full text on) contain at least one of these words or phrases (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Story must not contain",
            "type": "array",
            "description": "Leave out stories whose title, subtitle, tags (or text, with full text on) contain any of these.",
            "items": {
              "type": "string"
            }
          },
          "includeContent": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Add the story body as plain text and Markdown (headings, lists, quotes, code blocks with their language, links, images), its image links, outbound links, code-block and paragraph counts and a table of contents. Free stories come complete; member-only stories give the public preview (contentIsPreview = true). No extra charge: the text rides along with each page of stories.",
            "default": false
          },
          "includeHtml": {
            "title": "Include HTML",
            "type": "boolean",
            "description": "Also add the body as HTML (contentHtml), e.g. to republish formatting in your own reader. No extra charge.",
            "default": false
          },
          "includeImagesInMarkdown": {
            "title": "Images in the Markdown",
            "type": "boolean",
            "description": "Keep the story's images in contentMarkdown. Off = text only.",
            "default": true
          },
          "includeResponses": {
            "title": "Include responses (comments)",
            "type": "boolean",
            "description": "Add the responses of every delivered story as rows (type = response) with full text, writer, claps, clappers and reply count. Charged per response row.",
            "default": false
          },
          "maxResponsesPerPost": {
            "title": "Max responses per story",
            "minimum": 0,
            "type": "integer",
            "description": "Responses (and replies) per story, in Medium's order. 0 = all.",
            "default": 20
          },
          "includeReplies": {
            "title": "Include replies to responses",
            "type": "boolean",
            "description": "Also follow the reply threads under each response (depth 2, 3 ...), within Max responses per story.",
            "default": false
          },
          "includeProfiles": {
            "title": "Add a profile row per tag, writer, publication and list you listed",
            "type": "boolean",
            "description": "One extra row for every tag (story count, followers, related tags), writer (followers, following, bio, membership, Partner Program, books, X and Mastodon handles, posting activity, median claps and responses, top story) and publication (followers, description, editors, activity) you list, and each list link. Charged as a profile row.",
            "default": false
          },
          "includeArticles": {
            "title": "Include the stories of listed sources",
            "type": "boolean",
            "description": "Off = only the profile rows of the tags, writers, publications and lists you listed (needs the profile switch above).",
            "default": true
          },
          "includeAuthors": {
            "title": "Add a row per writer found",
            "type": "boolean",
            "description": "Also one row per writer of the delivered stories (name, bio, followers, following, avatar, membership, Partner Program, X handle). Charged as a profile row, capped by Max profile rows.",
            "default": false
          },
          "includePublications": {
            "title": "Add a row per publication found",
            "type": "boolean",
            "description": "Also one row per publication of the delivered stories (followers, description, logo, domain, editors, creator). Charged as a profile row, capped by Max profile rows.",
            "default": false
          },
          "maxProfiles": {
            "title": "Max profile rows",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on the extra profile rows above (listed sources plus found writers and publications). 0 = no cap.",
            "default": 100
          },
          "compareWithAuthor": {
            "title": "Compare each story with its writer's median",
            "type": "boolean",
            "description": "Adds authorMedianClaps (median claps of the writer's latest 25 stories older than 48 hours) and vsAuthorMedian (this story's claps divided by it: 4.2 = four times the writer's usual). One extra request per distinct writer; no extra charge.",
            "default": false
          },
          "monitorMode": {
            "title": "Only new stories since the last run",
            "type": "boolean",
            "description": "Remember what this setup delivered and return (and charge) only stories that were not delivered before. Newest-first tags and writers stop reading at the newest story already delivered, so an empty poll costs almost nothing. Pair with a schedule.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Runs with the same name share one memory (letters, digits, dashes). Default: derived from the sources and filters, so each different input has its own memory."
          },
          "resetMonitor": {
            "title": "Start the monitor over",
            "type": "boolean",
            "description": "Forget what this monitor delivered before; this run delivers everything again and becomes the new baseline.",
            "default": false
          },
          "maxItems": {
            "title": "Max stories",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many story rows in total (or rows of a people / publication / tag / list search). Responses and add-on profile rows have their own caps. 0 = no limit.",
            "default": 100
          },
          "maxPostsPerSource": {
            "title": "Max stories per tag / writer / publication / search / list",
            "minimum": 0,
            "type": "integer",
            "description": "Cap for each single source, so one big source cannot use up the whole run. 0 = no per-source cap.",
            "default": 0
          },
          "dedupe": {
            "title": "Remove duplicates across sources",
            "type": "boolean",
            "description": "A story found by several tags, searches or writers is delivered (and charged) once.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Sources in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many sources are read at the same time (each source pages one request after another).",
            "default": 8
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout of each request to Medium.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave empty: the actor talks to Medium directly and moves to Apify datacenter, then residential proxy by itself only if Medium refuses. Pick a proxy group or your own proxy URLs to send every request through them first."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}