2

I'm using the Wikipedia API to retrieve links within pages, and backlinks to those pages. Is there any way to filter results of prop=links, prop=linkshere or list=backlinks to retrieve only results that e.g. begin with a certain letter? Something like from=La&to=Lz would be nice - but it doesn't appear to be available.

At the moment the solution I have is to get ALL the links, using the continuation parameters, then just pull out those that match my criteria. But this can sometimes require numerous API calls, and seems a bit inelegant. Have I missed any other options?

thehattery
  • 125
  • 7

2 Answers2

1

I've now had an answer from the Wikimedia API mailing list: "There isn't anything like this available at the moment. It might be able to be added, but that doesn't help you right now."

Tgr
  • 27,442
  • 12
  • 81
  • 118
thehattery
  • 125
  • 7
1

If you don't need to results to be perfectly up-to-date, you can use the database dumps (published once a month or so) and then it's just a trivial SQL query.

Alternatively, you can implement that API yourself on Wikimedia Labs which allows you to create web services which have access to a live DB mirror of Wikipedia.

Tgr
  • 27,442
  • 12
  • 81
  • 118