0

I am trying to retrieve list of pages which link to given Wikipedia page. Can anyone suggest how to do this?

DDC
  • 834
  • 2
  • 9
  • 27

1 Answers1

2

https://en.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle=Main%20Page&bllimit=5&blfilterredir=redirects etc. See https://www.mediawiki.org/wiki/API:Backlinks for the full documentation.

Nemo
  • 2,441
  • 2
  • 29
  • 63
  • Thank you, your post was very helpful. However when I set the limit=max, it only gives me 500 results, which I guess is the maximum possible via online api, and for more results I should use the wikipedia dump, am I right? Since I'm a student and I am parsing the xml dump to save it to sql server and it is taking a lot of time, I was wondering if there were other way. I also tried to use the mysql dump, but mysql didn't respond for one week and I just stopped it. – Andi Keikha Feb 19 '15 at 19:53
  • @Andi you need to handle query continuation; the results limit only limits the amount of data you can get with a *single* request, not the total. The API docs explain how, but you'd better use a [client library](https://www.mediawiki.org/wiki/API:Client_code) to avoid headaches. – Nemo May 03 '15 at 21:23