(Using Medium API Python Package)
If you're interested in finding Medium users based on specific criteria,
you can easily do so using the Medium API in Python. This guide will walk
you through the process step-by-step. The only prerequisite is to install
the medium-api
library, which you can do with the command:
pip install medium-api
Let's go through the Python code that searches for users on Medium and prints their details.
Here, we use the os
library to access environment variables and the Medium
class from the medium_api
library to interact with the Medium platform.
Make sure you have set the RAPIDAPI_KEY
environment variable with your Medium API key. This key is essential for authenticating your requests to the Medium API.
This object will be used to interact with the Medium API for various operations, including searching for users.
The query
parameter specifies the search term, and save_info
is an optional parameter that, if set to True
, will save user information. Note that enabling save_info
can consume a significant number of API calls.
This loop iterates over the list of users returned by the search_users
method, displaying each user's full name, username, and bio.
By following these steps, you can efficiently search for Medium users based on specific criteria and access their information programmatically. Just ensure that you manage your API calls wisely, especially if using the save_info
option.