API Documentation

Getting started with Unofficial Medium API

Medium API Cover Image - By the Author

Hey guys!

This is the "Getting Started" Guide for the Medium API (Unofficial Version), listed on the RapidAPI Platform.

This REST API helps you to quickly extract data from medium.com, without any hassle.

Using our Unofficial Medium API, you can get -

馃挕 Checkout our swagger documentation for the details on each endpoint!


Before getting started, you must first get your API Key to authenticate your calls. You'll need to pass it in the headers, along with the requests, to use the API smoothly.

Header -

x-rapidapi-key: [RAPIDAPI_KEY]

Wondering how to subscribe to our API and get API Key? Watch the following video -


API's Base URL:

https://medium2.p.rapidapi.com

Endpoints:

User 馃懃  :GET User IDGET User InfoGET User's ArticlesGET User's Top ArticlesGET User's FollowingGET User's FollowersGET User's InterestsGET User's ListsGET User's Publications

Article 鉁忥笍 :GET Article InfoGET Article's ContentGET Article's MarkdownGET Article's HTMLGET Article's ResponsesGET Article's FansGET Related Articles

Publication 馃摪  :GET Publication IDGET Publication InfoGET Publication ArticlesGET Publication's Newsletter

Misc 馃寑  :GET Latest PostsGET Top WritersGET Top FeedsGET Tag InfoGET Related Tags

List 馃摐  :GET List InfoGET List ArticlesGET List Responses

Search 馃攷  :Search ArticlesSearch PublicationsSearch UserSearch ListsSearch Tags

GET User ID

Every Medium user has one unique hash ID associated with his/her account. Usually, we only deal with usernames that we choose while registering on Medium Platform. You can find your username in the sub-domain of your profile page URL or at the end of it. Like -

Once you get your username, like mine is nishu-jain, you can use the following endpoint to get your user_id.

Endpoint -

GET /user/id_for/{username}

Usage -

Once you have the user_id, you can invoke other user-related endpoints using it.


GET User Info

Once you've got the user_id, you can use it to get user-related information such as - Full name, Username, Bio, Followers & Following count, Twitter username, Profile-image, top writer status, etc ...

Endpoint -

GET /user/{user_id}

If you don't have the user_id, see the GET User ID endpoint above.

Usage -


GET User's Articles

This endpoint returns a list of articles (article_ids) written by the Medium user.

馃挕 You can then use the GET Article Info endpoint to retrieve information, such as title, subtitle, author, claps, voters, tags, topics, publication, etc..., related to your desired article.

Endpoint -

GET /user/{user_id}/articles

Usage -


GET User's Top Articles

This endpoint returns a list of aritcle_ids of the top 10 posts/articles on the user's profile (usually in chronological order - most recent posts), for the given user (user_id).

馃挕 You can then use the GET Article Info endpoint to retrieve information on individual articles.

Endpoint -

GET /user/{user_id}/top_aritcles

Usage -


GET User's Following

This endpoint returns a list of user_ids of the given user's followings.

You can fetch this list and use the GET User Info endpoint to retrieve information related to the individual users.

Note: Currently, this list does not contain the publication_ids of the publications that the user is following.

Query Parameters (Optional): -

Endpoint -

GET /user/{user_id}/following

Usage鈥


GET User's Followers

This endpoint returns a list of user_ids of the followers for the given user.

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.

You can use the GET User Info endpoint to retrieve information related to the individual users.

Query Parameters (Optional): -

Endpoint -

GET /user/{user_id}/followers

Usage -


GET User's Interests

This endpoint returns a list of tags that the given user follows on Medium.

All tags are lowercased hyphen-separated strings.

Endpoint -

GET /user/{user_id}/interests

Usage鈥


GET User's Lists

This endpoint returns an array of list_ids created by the user.

You can use the GET List Info endpoint to retrieve information on individual Medium Lists.

Endpoint -

GET /user/{user_id}/lists

Usage -


GET User's Publications

This endpoint returns a list of publication_ids where the user is the editor and/or creator.

You can use the GET Publication Info endpoint to retrieve information on individual publications.

Endpoint -

GET /user/{user_id}/publications

Usage -


GET Article Info

This endpoint returns the article-related information such as Title, Subtitle, Author, Tags, Topics (as assigned by Medium), Publication, Published date and time, Clap Count, Voter Count, Word Count, Responses Count, Reading Time, Language, etc...

For using this endpoint, you'll need an article's unique hash ID, called article_id.

You can find the article_id at the end of any Medium Story's URL. Like -

Endpoint -

GET /article/{article_id}

Usage -


GET Article's Content

This endpoint returns the textual content of an article/story, for the corresponding article_id.

You can get the article_id from the URL, as shown above in the GET Article Info endpoint.

Endpoint -

GET /article/{article_id}/content

Usage -


GET Article's Markdown

This endpoint returns the article content in the markdown format (.md), for the corresponding article_id.

You can get the article_id from the URL, as shown above in the GET Article Info endpoint.

Endpoint -

GET /article/{article_id}/markdown

Usage -


GET Article's HTML

This endpoint returns the article in plain HTML format (.html), for the corresponding article_id.

You can get the article_id from the URL, as shown above in the GET Article Info endpoint.

Query Parameter (Optional) : -

Endpoint -

GET /article/{article_id}/html

GET /article/{article_id}/html?fullpage=true

Usage -


GET Article's Responses

This endpoint returns a list of responses (response_ids, same as article_ids) for a given article (article_id)

Note: You can treat response_id pretty much same as aritcle_id. To see the content of the response, use the Get Article's Content endpoint.

Endpoint -

GET /article/{article_id}/responses

Usage -


GET Article's Fans

This endpoint returns a list of user_ids of the people who clapped on the article.

You can use the GET User Info endpoint to retrieve information on individual users.

Endpoint -

GET /article/{article_id}/fans

Usage -


GET Related Articles

This endpoint returns a list of article_ids of the related posts. (Length = 4)

Note: The related aritcles will belong to the same author or same publication.

Endpoint -

GET /article/{article_id}/related

Usage -


GET Publication ID

Every Medium Publication has one unique hash ID associated with it. Usually, we only deal with publication_slug that is generated when we choose our Publication's Name. You can find your publication_slug in the homepage URL of your publication. Like -

Once you get your publication_slug, you can use the following endpoint to get your publication_id.

Endpoint -

GET /publication/id_for/{publication_slug}

Usage -


GET Publication Info

This endpoint returns publication-related information such as Publication name, Tagline, Description, Tags, Followers Count, Creator, Editors, Twitter username, Instagram username, Facebook Page name, Logo, Domain, etc ... for the corresponding publication_id.

A publication_id is the unique hash ID associated with every Medium Publication. For example, publication_id of TowardsDataScience is "7f60cf5620c9"

If you don't know the publication_id, you can get it from any article published under it. Use the endpoint GET Article Info, to retrieve the publication_id. Or, if you know the publication_slug, use the endpoint GET Publication ID.

Endpoint -

GET /publication/{publication_id}

Usage -


GET Publication Articles

This endpoint returns the list of articles_ids of the latest 25 articles, posted recently in that publication.

You can use the GET Article Info endpoint to retrieve information on individual articles.

Query Parameter (Optional): -

Endpoint -

GET /publication/{publication_id}/articles

Usage -


GET Publication's Newsletter

This endpoint returns information related to the associated newsletter for the given publication. This includes their name, description, creator's id, subscriber's count, unique id, image url, etc...

Endpoint -

GET /publication/{publication_id}/newsletter

Usage -


GET Latest Posts

This endpoint returns a list of the latest posts (article_ids) under a topic/niche (as classified and distributed by the Medium platform). Examples of a topic/niche can be:

These are known as topic_slugs. (Not same as tags)

At any given moment, this endpoint will return a list of 25 articles (article_ids). You can then GET Article Info endpoint to retrieve information related to each article.

Endpoint -

GET /latestposts/{topic_slug}

Usage -


GET Top Writers

This endpoint returns a list of top writers (user_ids) within a particular topic/niche (using topic_slug). Examples of topic_slug are -

You can use an optional query parameter count to specify the number of top writers you want to retrieve.

Note: Maximum number of top writers within a topic will be 250.

After fetching the user_ids, you can use the GET User Info endpoint to extract information related to the individual users.

Endpoint -

GET /top_writers/{topic_slug}

GET /top_writers/{topic_slug}?count={count}

Usage鈥


GET Top Feeds

This endpoint returns a list of article_ids (default count = 25) for the given tag and mode.

Example of a tag will 鈥榖lockchain', 鈥榙efi', 鈥榓rtificial-intelligence', etc...

Mode:

Note: You can use the GET Article Info endpoint to retrieve information related to each article.

Query Parameters (Optional) : -

Endpoint -

GET /topfeeds/{tag}/{mode}

Usage -


Get Tag Info

This endpoint returns tag-related information for the given tag. This includes:

Note: tags are lowercased, hyphen-separated strings representing a category or niche on Medium Platform

Endpoint -

GET /tag/{tag}

Usage -


Get Related Tags

This endpoint returns a list of related_tags for a given tag.

Example: For the tag blockchain, it will return "cryptocurrency", "bitcoin", "ethereum", "crypto", "ico", "technology", "defi", "nft", "fintech".

Endpoint -

GET /related_tags/{tag}

Usage -


GET List Info

This endpoint returns the Medium's list-related information - such as id, name, author, description, thumbnail image url, creation datetime, last modified datetime, number of articles in the list, claps, voters, and comments - for the given list_id.

The list_id is the unique hash ID associated with every Medium List. You can see it at the end of the URL as follows:

Here 38f9e0f9bea6 is the list_id.

Endpoint -

GET /list/{list_id}

Usage -


GET List Articles

This endpoint returns an array of article_ids present in the given Medium List.

You can use the GET Article Info endpoint to retrieve information on individual articles.

Endpoint -

GET /list/{list_id}/articles

Usage -


GET List Responses

This endpoint returns an array of response_ids for the given Medium List.

Note: You can treat response_id pretty much same as aritcle_id. To see the content of the response, use the Get Article's Content endpoint.

Endpoint -

GET /list/{list_id}/responses

Usage -


Search Articles

This endpoint returns a list of article_ids that match the search query. The maximum length of this list will be 1000. If no articles are found that match the search query, then an empty list will be returned.

Query Parameter (Required): -

You can use the GET Article Info endpoint to retrieve information on individual articles.

Endpoint -

GET /search/articles?query={query}

Usage -


Search Publications

This endpoint returns a list of publication_ids that match the search query. The maximum length of this list will be 1000. If no publications are found that match the search query, then an empty list will be returned.

Query Parameter (Required): -

You can use the GET Publication Info endpoint to retrieve information on individual publications.

Endpoint -

GET /search/publications?query={query}

Usage -


Search Users

This endpoint returns a list of user_ids that match the search query. The maximum length of this list will be 1000. If no users are found that match the search query, then an empty list will be returned.

Query Parameter (Required): -

You can use the GET User Info endpoint to retrieve information on individual users.

Endpoint -

GET /search/users?query={query}

Usage -


Search Lists

This endpoint returns an array of list_ids that match the search query. The maximum length of this array will be 1000. If no Medium Lists are found that match the search query, then an empty array will be returned.

Query Parameter (Required): -

You can use the GET List Info endpoint to retrieve information on individual Medium Lists.

Endpoint -

GET /search/lists?query={query}

Usage -


Search Tags

This endpoint returns a list of tags that match the search query. The maximum length of this list will be 1000. If no tags are found that match the search query, then an empty list will be returned.

Query Parameter (Required): -

Endpoint -

GET /search/tags?query={query}

Usage -


Final thoughts -

As of now, this API consists of 33 endpoints, all of which use the GET method. I'll try to add more endpoints in the future and improve its efficiency to provide you with the best Unofficial Medium API possible.

If you've any thoughts on it, feel free to share them. I'll appreciate your feedback and try to improve it further.

My email ID: nishu@mediumapi.com

Thanks for reading and have a wonderful day!


PS: We post tutorials, videos, code snippets, and insights related to Medium and Unofficial Medium API. So be sure to follow us on: