The Easiest Way To Get Data From Medium Posts API and Display in Your React App
This article will show you how to Fetch a GET Request for Medium blog posts in your React application, without using any external packages.
I will be covering how I’ve added my client’s Medium blog to her business website. The website was built with ReactJS and TailwindCSS and does not have any backend. Hence, this is the most efficient method I’ve implemented to automatically fetch and update her website with her latest Medium blog posts.
This is how my client’s website Medium blog section looks like:-
Assuming you have created your React project, let’s dive straight into fetching Medium blog post data.
Step 1: API Endpoint to retrieve your blog posts
We can get our blog posts through this API endpoint and replace the text “username”
with your own username: https://medium.com/feed/@username
However, this API endpoint returns the data in RSS format. Hence, we need to use a Free Online RSS to JSON converter. So our API endpoint will now become:
https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@username