0

I am making a ReactJS application to show information about people when they search for it. I am trying to use MediaWiki to get the information about a person from Wikipedia. I am making an API call and the response is very weird. I am getting this whole bunch of "claims" in the API response from which I don't know how to take the useful info

This is the response I get:

response

Now what should I do with these claims? The information itself is scattered there. For example: "Date of birth" key is in some other claim and the value of "Date of death" is in some other claim. I want to show information like this in my page:

output

How can I do it? I couldn't get any guide for this.

Termininja
  • 6,620
  • 12
  • 48
  • 49
EdG
  • 2,243
  • 6
  • 48
  • 103

1 Answers1

1

All information you need for item Q2038656 is in your response. For example:

  • P18 is image - located in P18/mainsnak/datavalue/value/Vinod Khanna at Esha Deol's wedding at ISCKON temple 11 (cropped).jpg (check here how to get the link to the image)
  • P19 is place of birth - in P19/mainsnak/datavalue/value/id/Q1113311 (you can get the name of this item by this query: Peshawar)
  • P569 is date of birth - in P569/mainsnak/datavalue/value/time/+1946-10-06T00:00:00Z

...continue in the same way for all other properties.

Termininja
  • 6,620
  • 12
  • 48
  • 49