How to Get a Medium User's Followers

Using the Medium API with JavaScript

In today's digital world, understanding audience engagement is key to content success. If you're looking to analyze a Medium user's followers for networking, marketing, or content analysis, this guide will help you achieve that using the Medium API.

By leveraging the Medium API, you can programmatically fetch follower details for any user, enabling data-driven decisions.

Prerequisites

To get started, ensure you have the following:

Code Breakdown

Let’s break down the process of fetching a Medium user’s followers step-by-step.

Importing Required Modules

import Medium from 'medium-api-js';
import dotenv from 'dotenv';

dotenv.config();

Setting Up API Access

const medium = new Medium(process.env.RAPIDAPI_KEY);

Defining Parameters

const userId = '14d5c41e0264';
const count = 20;
let after = "";

Fetching Followers

medium.getUserFollowers(userId, count, after)
    .then(data => {
        console.log('User Followers:', data);
    });

Running the Code

Save the script as getUserFollowers.js. Execute it using the following command:

node getUserFollowers.js

Output and Explanation

On running the script, you will see the following output:

Potential Use Cases

Summary

Retrieving a Medium user's followers is an essential step in understanding audience engagement and improving content strategies. By leveraging the Medium API, you can efficiently fetch and analyze follower data for various use cases.

If you have any questions about the Medium API or need further assistance, feel free to reach out to me at nishu@mediumapi.com.

Best of luck with your projects!

nishu@mediumapi.com