0

I am trying to pull specific information such as name, downloadCount etc from this API so I can display them as text on my website, but it is all formatted as a wall of plain text rather than a json file I can just pull from the url.

URL: https://staging_cursemeta.dries007.net/api/v3/direct/addon/268210

How should I go forward with pulling data and how shall I access specific fields from this kind of APIs. I am using JavaScript.

andrew
  • 8,963
  • 7
  • 27
  • 58
Ewy
  • 21
  • 1
  • 4

1 Answers1

1

To convert a JSON like structure in text format to JSON, you need JSON.parse

const data = JSON.parse(`{
 "description": "lorem ipsum",
 "error": true,
 "status": 404
}`);

console.log(data.status);
Kamlesh Tajpuri
  • 462
  • 3
  • 11