How to Get Responses (Comments) on a Medium List

Using Medium API JS Package

Fetching responses or comments on a specific Medium list can be extremely valuable for content creators, developers, or marketers looking to analyze engagement and feedback.

Whether you’re building analytics tools or simply want to monitor user interaction on a Medium list, this guide shows you how to achieve this using the medium-api-js package.

By the end, you’ll know how to fetch comments from any Medium list programmatically.

Prerequisites

Before diving into the implementation, ensure you have the following:

You can install the necessary dependencies using the following commands:

npm install medium-api-js dotenv

Code Explanation

This script fetches responses to a Medium list by its ID. Let’s break it down step-by-step:

Step 1: Import Required Packages

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

dotenv.config();

Step 2: Initialize Medium API

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

Step 3: Fetch List Responses

medium.getListResponses('3d8f744f5370').then(data => {
    console.log('List Responses:', data);
});

Running the Code

Save the code to a file named getListResponses.js and execute it using the following command in your terminal:

node getListResponses.js

Ensure that your .env file contains your API key in the following format:

RAPIDAPI_KEY=your_medium_api_key_here

Output Explanation

When you run the script, the output will look like this:

Potential Use Cases

Summary

This guide walked you through the setup, implementation, and potential applications of using Medium API JS package to get responses on a Medium list.

If you have any questions about Medium API or this code, feel free to reach out at nishu@mediumapi.com.

Start leveraging Medium’s data today to understand your audience better!

nishu@mediumapi.com