Skip to content

Using medium api to fetch post information and display it to the webpage

License

Notifications You must be signed in to change notification settings

NSU-ACM-SC/mediumApiCall

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medium Api Call

Medium Api : " https://medium.com/feed/@USERNAME "

This will return data in XML format which is given below.

APIRESULT

But JSON is much easier to work. RSS2JSON is a free online Api that will convert the given XML to JSON. And the best part is you can do the whole process at once, you don't have to get the XML first then convert it to JSON.

Api Url : " https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@USERNAME "

The result will be something like this and in JSON format

JSON

Now just fetch it and you are done !! 😋😋

fetch('https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@USERNAME')
  .then((res) => res.json();
  .then((data) => {
    console.log(data);
  });

Check out the demo here : https://codepen.io/Jack_Frost/pen/yLypLZE?editors=1010

About

Using medium api to fetch post information and display it to the webpage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 51.1%
  • HTML 48.9%