2

For the text query "major+histocompatibility+complex+class+II+antigens" I get different results using the web and api interfaces. Is there a way to get the same results as the web interface using the api?

Query with web interface:

http://en.wikipedia.org/w/api.php?action=opensearch&search=major+histocompatibility+complex+class+II+antigens

Query with api:

http://en.wikipedia.org/w/api.php?action=opensearch&search=major+histocompatibility+complex+class+II+antigens

I looked at the api reference (http://en.wikipedia.org/w/api.php) and question on SO (http://stackoverflow.com/questions/1397938/is-there-any-api-in-java-to-access-wikipedia-data) but none of them dealt with this issue. Is the opensearch api using a different search engine?

nflacco
  • 4,972
  • 8
  • 45
  • 78

1 Answers1

6

action=opensearch does not do what you think. It searches for page titles beginning with the entered prefix, for use in completion of input in a search box or the like. The API equivalent of Special:Search is list=search.

Anomie
  • 92,546
  • 13
  • 126
  • 145
  • 1
    fantastic, http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=major+histocompatibility+complex+class+II+antigens works appropriately – nflacco Apr 28 '11 at 02:31