How to Get Medium Lists Created by a User

(Using Medium API Python Package)

If you're interested in retrieving and displaying the lists created by a Medium user, this guide will walk you through the process using Python and the Medium API. Make sure you have medium-api installed. If not, you can install it using the command:

pip install medium-api

Step 1: Import the Required Libraries

First, you need to import the necessary libraries. The medium_api library provides the functionality to interact with the Medium API.

Step 2: Retrieve the API Key

The Medium API requires an API key for authentication. You'll need to store this key in your environment variables. Here's how you can fetch it:

Step 3: Create a Medium Object

With the API key, create an instance of the Medium class. This object will be used to interact with the Medium API.

Step 4: Create a User Object

Next, create a User object using the Medium instance. You'll need to specify the username of the Medium user whose lists you want to fetch.

Step 5: Fetch and Display the Lists

Finally, fetch the user's list-related information and display the names of the lists along with the number of articles in each list.

By following these steps, you can easily retrieve and display the lists created by any Medium user using the Medium API.

Output