Medium REST API Example Calls with Python Requests

Jess Schalz
10 min readFeb 11, 2022

A tutorial showing how to get an integration token, set headers, and retrieve and post data from the Medium REST API.

Author’s Note

Up front, I’m the reason this repo was archived. I’d almost finished this post when I emailed the Medium customer support team and asked for clarification on the repo.

An email from Jessica Schalz (me) to the Medium support team. I ask if they can enable issues in the repo, or update it if it isn’t formally maintained.
Include links/info for your support teams and make their lives easier.

And, uh…

An email reply from Lucius on Medium’s User Services team: “Thanks for pointing this out. That repo has been archived and is no longer maintained.”
…shit.

The repo was archived before I finished the last available endpoint in the API, /images. I don’t know if these endpoints are still available, and I don’t know if that last endpoint would even work. (I do remember being able to upload images and search for them based on file name.) Regardless, I didn’t include it in the post here.

I’m still posting this because I feel like it’s a good resource for folks looking to do simple Medium automation, but be warned. Thar be unmaintained dragons.

Medium has a REST API! Documentation exists online on GitHub here.

The documentation hasn’t been updated since September 2020, though, so it may have been abandoned. In the meantime, I was curious about what endpoints still work. Let’s explore!

Prerequisites:

Auth with Integration/Access Token

According to the documentation, all calls to their API resources require OAuth2 authentication. There are two ways to accomplish this: create an integration token for your account, or retrieve an access token for existing integrations. The first option is significantly easier, especially since I don’t have any third parties associated with my account, so I’ll walk through how to do that.

First, navigate to https://www.medium.com/me/settings. You can do this either through entering that directly in your search bar, or when logged in you can click on your icon in the top right corner of the screen. Click the Settings link in the drop down menu.

Jess Schalz

Software engineer turned technical writer and autistic as heck. (she/they) @jessica_schalz