Medium API (Unofficial) (1.0)

Download OpenAPI specification:Download

Our Unofficial Medium API helps you to quickly extract data from Medium's Website (https://medium.com).

You can gather data related to users, publications, articles (including its textual content), latest posts & top writers within a topic/niche, etc…

Welcome

Get Welcome

Test Endpoint Returns the information about the Unofficial Medium API

Responses

Response samples

Content type
application/json
{}

User

Get User ID

Returns the unique user_id for the given username.

Note: You can find the username from the user's/author's profile page URL.

  • username.medium.com
  • medium.com/@username
path Parameters
username
required
string
Example: nishu-jain

It's a unique string chosen by every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "1985b61817c3"
}

Get User Info

Returns user-related information such as their

  • Username
  • Full name
  • Bio
  • Followers count
  • Following count
  • Publication Following count
  • Twitter Username
  • Profile Image URL
  • Background Image URL
  • Logo Image URL
  • Tipping Link
  • List of tags in which the user is Top Writer
  • When did the user become a Medium Member (conditional)
  • Whether the user has Lists (boolean)
  • Whether the user is a Medium-verified book author (boolean)
  • Whether the user is enrolled in Medium Partner Program (boolean)
  • Whether the user has allowed notes on their articles (boolean)
  • Whether the user is suspended or not (boolean)

Note: If you don't know the user_id, you can get it from the Get User ID endpoint (/user/id_for/{username}).

path Parameters
user_id
required
string
Example: 1985b61817c3

It's a unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{}

Get User's Articles

Returns the list of articles (article_ids) written by the given user.

path Parameters
user_id
required
string
Example: 1985b61817c3

Unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "1985b61817c3",
  • "associated_articles": [
    ],
  • "count": 5
}

Get User's Top Articles

Returns a list of article_ids of the top 10 articles on the user's profile, for a given user_id.

path Parameters
user_id
required
string
Example: 1985b61817c3

Unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "1985b61817c3",
  • "top_articles": [
    ]
}

Get User Followers

Returns the list of user_ids of the user's followers.

Note: When you get the response from the API, it will include an attribute called next. You can use this next attribute as query string parameter (after) when you make your next API request. This way, you can get the followers that come after the one you're currently looking at.

path Parameters
user_id
required
string
Example: 1985b61817c3

Unique hash id assigned to every single Medium user.

query Parameters
count
int
Example: count=10

To limit the number of results. (count <= 25)

after
string
Example: after=14274b746ca3

To get the results after a particular follower's user id.

Responses

Response samples

Content type
application/json
{
  • "id": "1985b61817c3",
  • "followers": [
    ],
  • "count": 10,
  • "next": "16759d70a68f",
  • "total_followers": 721
}

Get User Following

Returns a list of users (user_ids) that the given user is following.

Use the count query parameter (optional) to limit the number of results. (count <= 1500)

Note: This list does not contain the publication_ids of the publications that the user is following. To get those, please use Get User Publication Following endpoint (/user/{user_id}/publication_following).

path Parameters
user_id
required
string
Example: 14d5c41e0264

Unique hash id assigned to every single Medium user.

query Parameters
count
int
Example: count=10

To limit the number of results. (count < 1500)

Responses

Response samples

Content type
application/json
{
  • "id": "14d5c41e0264",
  • "following": [
    ]
}

Get User Publication Following

Returns a list of publications (publication_ids) that the given user is following.

path Parameters
user_id
required
string
Example: 1985b61817c3

Unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "1985b61817c3",
  • "publication_following": [
    ],
  • "count": 2
}

Get User's Interests

Returns a list of tags that the given user follows.

path Parameters
user_id
required
string
Example: 1985b61817c3

Unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "1985b61817c3",
  • "tags_followed": [
    ],
  • "count": 5
}

Get User's Lists

Returns an array of list_ids created by the user.

Note: You can check whether the use has created lists or not beforehand. Check the has_list attribute in the "Article Info" endpoint.

path Parameters
user_id
required
string
Example: 5142451174a3

Unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "5142451174a3",
  • "lists": [
    ],
  • "count": 8
}

Get User's Publications

Returns 2 lists of publication_ids where the given user is either an admin (creator/editor) or a contributing writer.

path Parameters
user_id
required
string
Example: 14d5c41e0264

Unique hash id assigned to every single Medium user.

Responses

Response samples

Content type
application/json
{
  • "id": "14d5c41e0264",
  • "publications": {
    }
}

Publication

Get Publication ID

Returns the unique publication_id for the given publication_slug.

Note: You can find the publication_slug from the publication's homepage URL.

  • medium.com/publication_slug
path Parameters
publication_slug
required
string
Example: codex

It's a lowercased hyphen-separated unique string alloted to each Medium Publication.

Responses

Response samples

Content type
application/json
{
  • "publication_id": "29038077e4c6",
  • "publication_slug": "codex"
}

Get Publication Info

Returns the publication related information such as Publication name, Tagline, Description, Tags, Followers Count, Twitter username, Instagram username, Facebook Page name, etc …

Note: If you don't know the publication_id, you can get it from any article published by it. Use endpoint "/article/{article_id}" to retrieve the publication_id.

path Parameters
publication_id
required
string
Example: 98111c9905da

It's a unique hash id assigned to every Medium Publication.

Responses

Response samples

Content type
application/json
{
  • "id": "98111c9905da",
  • "name": "Towards AI",
  • "tagline": "The World's Leading AI and Technology Publication",
  • "description": "Towards AI is the world's leading AI and technology publication. Publishing unbiased AI and technology-related articles. Read by thought-leaders and decision-makers around the world.",
  • "tags": [
    ],
  • "followers": 25260,
  • "instagram_username": "towards_ai",
  • "facebook_pagename": "towardsAl",
  • "url": "pub.towardsai.net",
  • "slug": "towards-artificial-intelligence",
  • "twitter_username": "towards_AI",
  • "creator": "8a819983d566",
  • "editors": [
    ]
}

Get Publication Articles

Returns the list of articles_ids, of the latest 25 articles, posted in that publication.

path Parameters
publication_id
required
string
Example: 98111c9905da

It's a unique hash id assigned to every Medium Publication.

query Parameters
from
string
Example: from=2023-01-31T13:10:00

To get the articles before specified date and time.

Responses

Response samples

Content type
application/json
{
  • "publication_articles": [
    ],
  • "publication_id": "98111c9905da",
  • "from": "2022-08-13 03:08:16",
  • "to": "2022-08-05 12:02:25"
}

Get Publication Newsletter

Returns the newsletter related information such as id, name, description, slug, creator_id, subscribers, image_url, etc …

Note: If you don't know the publication_id, you can get it from any article published by it. Use endpoint "/article/{article_id}" to retrieve the publication_id.

path Parameters
publication_id
required
string
Example: 98111c9905da

It's a unique hash id assigned to every Medium Publication.

Responses

Response samples

Content type
application/json
{
  • "id": "d710a73cd042",
  • "name": "This AI newsletter is all you need",
  • "description": "We have moved our newsletter. Subscribe → https://ws.towardsai.net/subscribe",
  • "subscribers": 6752,
  • "slug": "this-ai-newsletter-is-all-you-need",
  • "creator_id": "aea8a19ea239",
}

Article

Get Article Info

Returns article-related information such as

  • Title
  • Subtitle
  • Author (ID)
  • Tags
  • Topics (assigned by Medium)
  • Publication (ID)
  • Published date and time
  • Last Modified date and time
  • Clap Count
  • Voter Count
  • Word Count
  • Response Count
  • Reading Time
  • Language
  • Unique Slug
  • URL
  • Image URL (Cover image)
  • Top Highlight
  • Whether the article is in a series or not (boolean)
  • Whether the article is a shortform or not (boolean)
  • Whether the article is locked or not (boolean)
path Parameters
article_id
required
string
Example: 67fa62fc1971

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "67fa62fc1971",
  • "title": "Why it's Super Hard to be an ML Researcher or Developer?",
  • "subtitle": "A Realization that Literally Changed my Life",
  • "author": "1985b61817c3",
  • "publication_id": "98111c9905da",
  • "responses_count": 6,
  • "word_count": 1146,
  • "reading_time": 4.874528301886793,
  • "topics": [
    ],
  • "tags": [
    ],
  • "claps": 603,
  • "voters": 141,
  • "is_series": false,
  • "is_shortform": false,
  • "is_locked": true,
  • "lang": "en",
  • "published_at": "2020-10-28 21:01:06",
  • "last_modified_at": "2023-06-20 06:37:11",
  • "unique_slug": "why-its-super-hard-to-be-an-ml-researcher-or-developer-67fa62fc1971",
  • "top_highlight": "Give me six hours to chop down a tree and I will spend the first four sharpening the axe - Abraham Lincoln\""
}

Get Article's Content

Returns the content of an article for the given article_id.

path Parameters
article_id
required
string
Example: 562c5821b5f0

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "562c5821b5f0",
  • "content": "Article title\nArticle Subtitle\nArticle Content ....\n"
}

Get Article's Markdown

Returns the markdown of a Medium Article/Story, for the given article_id

path Parameters
article_id
required
string
Example: 67fa62fc1971

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "67fa62fc1971",
  • "markdown": "# Article title\n## Article Subtitle\nArticle **Content** with lot of _markups_ ....\n![Images Alt](Image URL)\n"
}

Get Article's HTML

Returns the plain HTML of a Medium Article, for the given article_id.

Note: This plain HTML output can be stylized as per your own custom branding. For the sample CSS, visit: https://mediumapi.com/styles/dark.css

path Parameters
article_id
required
string
Example: ff6369938b63

It's a unique hash id assigned to every Medium Article.

query Parameters
fullpage
bool
Example: fullpage=false

If 'true', returns full HTML page with head, body, title and meta tags. Else, returns HTML inside body only.

style_file
string
Example: style_file=https://mediumapi.com/styles/dark.css

Name or link to a CSS file to be included in the HTML. It works when fullpage is true.

Responses

Response samples

Content type
application/json
{
  • "id": "ff6369938b63",
  • "html": "<div class=\"blog\">\n <h1 id=\"abcd\">Article Title<h1>\n <p>This is a <b>paragraph</b></p>\n <img src=\"https://example.com/img.png\" alt=\"Image caption\" />\n</div>\n"
}

Get Article Assets

Returns a list of URLs for the assets present in the Medium Article.

These assets may include images, embedded YouTube videos, Github Gists, Hyperlinks (anchors), Links to other Medium Articles, etc…

path Parameters
article_id
required
string
Example: b7d838c84f72

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{}

Get Article Responses

Returns a list of responses (response_ids, same as article_ids) for a given article (article_id)

Note: To see the content of the response, use the Get Article's Content endpoint (/article/{article_id}/content)

path Parameters
article_id
required
string
Example: 67fa62fc1971

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "67fa62fc1971",
  • "responses": [
    ],
  • "count": 6
}

Get Article Fans

Returns a list of user_ids of the people who clapped on the article (a.k.a voters).

path Parameters
article_id
required
string
Example: 67fa62fc1971

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "67fa62fc1971",
  • "voters": [
    ],
  • "count": 6
}

Get Recommended Articles

Returns a list of 10 articles (article_ids) as recommended by the Medium, for the given article.

path Parameters
article_id
required
string
Example: 67fa62fc1971

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "67fa62fc1971",
  • "recommended_articles": [
    ]
}

Get Related Articles

Returns a list of article_ids of the related posts. (Length = 4)

path Parameters
article_id
required
string
Example: 67fa62fc1971

It's a unique hash id assigned to every Medium Article.

Responses

Response samples

Content type
application/json
{
  • "id": "67fa62fc1971",
  • "related_articles": [
    ]
}

Platform

Get Recommended Feed

Returns a list of recommended articles (article_ids) for the given tag. This feed is similar to Topfeeds Trending Articles.

Using the page query string parameter, you can get the list page by page. The page number can be between 1 and 20. Each page will have up to 25 Article IDs.

So at maximum, you can fetch 500 article_ids in 20 API calls.

path Parameters
tag
required
string
Example: data-science

It's a unique string, usually hyphen-separated, representing a class of content.

query Parameters
page
integer
Example: page=1

A number between 1 and 20.

Responses

Response samples

Content type
application/json
{
  • "recommended_feed": [
    ],
  • "count": 25,
  • "tag": "data-science",
  • "page": 1
}

Get Topfeeds

Returns a list of article_ids (length: 25) for the given tag and mode.

path Parameters
tag
required
string
Example: data-science

It's a unique string, usually hyphen-separated, representing a class of content.

mode
required
string
Example: new

Mode:

  • hot : For getting trending articles
  • new : For getting latest articles
  • top_year : For getting best articles of the year
  • top_month : For getting best articles of the month
  • top_week : For getting best articles of the week
  • top_all_time: For getting best article of all time

Responses

Response samples

Content type
application/json
{
  • "topfeeds": [
    ],
  • "count": 25,
  • "tag": "data-science",
  • "mode": "NEW"
}

Get Top Writers

Returns a list of top writers (user_ids) within a particular topic/niche (topic_slug). e.g.

  • blockchain
  • relationships
  • artificial-intelligence, etc ...

Note: You can use optional count query parameter to limit the number of results. The maximum number of top writers within a topic/niche will be 250.

path Parameters
topic_slug
required
string
Example: artificial-intelligence

It's a unique string, usually hyphen-separated, representing a topic/niche, as classified by Medium.

query Parameters
count
int
Example: count=10

Limits the number of article_ids in the result.

Responses

Response samples

Content type
application/json
{
  • "top_writers": [
    ]
}

Get Latest Posts

Returns a list of latest posts (article_ids) for a topic/niche (as classified by the Medium platform). Example of a topic/niche can be:

  • blockchain
  • relationships
  • mental-health, etc …

These are known as topic_slugs. At any given moment, this endpoint will return a list of 25 articles (article_ids).

path Parameters
topic_slug
required
string
Example: blockchain

It's a unique string, usually hyphen-separated, representing a topic/niche, as classified by Medium.

Responses

Response samples

Content type
application/json
{
  • "latestposts": [
    ]
}

Get Related Tags

Returns a list of related_tags for the given tag.

path Parameters
tag
required
string
Example: blockchain

It's a unique string, usually hyphen-separated, representing a class of content.

Responses

Response samples

Content type
application/json
{
  • "related_tags": [
    ],
  • "given_tag": "blockchain"
}

Get Tag Info

Returns tag-related information.

  • Name
  • Followers Count
  • Number of stories
  • Number of writers
  • Number of latest stories
  • Number of latest writers
path Parameters
tag
required
string
Example: artificial-intelligence

It's a unique string, usually hyphen-separated, representing a class of content.

Responses

Response samples

Content type
application/json
{
  • "tag": "artificial-intelligence",
  • "name": "Artificial Intelligence",
  • "followers": 1581563,
  • "articles_count": 234250,
  • "authors_count": 87802,
  • "latest_articles_count": 483,
  • "latest_authors_count": 296
}

List

Get List Info

Returns the list-related information such as id, name, author, description, thumbnail image url, creation datetime, last article inserted datetime, number of articles in the list, claps, voters, and comments/responses.

path Parameters
list_id
required
string
Example: 38f9e0f9bea6

It's a unique hash id assigned to every Medium List.

Responses

Response samples

Content type
application/json
{
  • "id": "38f9e0f9bea6",
  • "name": "Medium API",
  • "description": "Collections of all the articles and resources related to Medium API",
  • "author": "1985b61817c3",
  • "count": 18,
  • "responses_count": 1,
  • "claps": 48,
  • "voters": 1,
  • "created_at": "2023-03-12 06:46:46",
  • "last_item_inserted_at": "2023-03-12 06:53:02",
}

Get List Articles

Returns an array of articles_ids present in the given Medium List.

path Parameters
list_id
required
string
Example: 3d8f744f5370

It's a unique hash id assigned to every Medium List.

Responses

Response samples

Content type
application/json
{
  • "id": "3d8f744f5370",
  • "list_articles": [
    ],
  • "count": 10
}

Get List Responses

Returns an array of response_ids of the comments (same as article_ids) on the given Medium List.

path Parameters
list_id
required
string
Example: 3d8f744f5370

It's a unique hash id assigned to every Medium List.

Responses

Response samples

Content type
application/json
{
  • "id": "3d8f744f5370",
  • "responses": [
    ],
  • "count": 2
}

Search

Search Users

Returns a list of user_ids for the given search query results. (Max Length = 1000)

query Parameters
query
required
string
Example: query=data engineer

Search query

Responses

Response samples

Content type
application/json
{
  • "users": [
    ],
  • "search_query": "data engineer"
}

Search Publications

Returns the list of publication_ids for the given search query results. (Max Length = 1000)

query Parameters
query
required
string
Example: query=mental health

Search query

Responses

Response samples

Content type
application/json
{
  • "publications": [
    ],
  • "search_query": "mental health"
}

Search Articles

Returns the list of articles_ids for the given search query results. (Max Length = 1000)

query Parameters
query
required
string
Example: query=startup

Search query

Responses

Response samples

Content type
application/json
{
  • "articles": [
    ],
  • "search_query": "startup"
}

Search Tags

Returns a list of tags for the given search query results. (Max Length = 1000)

query Parameters
query
required
string
Example: query=blockchain

Search query

Responses

Response samples

Content type
application/json
{
  • "tags": [
    ],
  • "search_query": "blockchain"
}

Search Lists

Returns an array of list_ids for the given search query results. (Max Length = 1000)

query Parameters
query
required
string
Example: query=artificial intelligence

Search query

Responses

Response samples

Content type
application/json
{
  • "lists": [
    ],
  • "search_query": "artificial intelligence"
}