- Support for all 283 languages on Wikipedia
- Support for all search parameters as of MediaWiki v1.24
Here is the simplest way of getting data from Wikipedia:
static async Task Main()
{
using WikipediaClient client = new WikipediaClient();
WikiSearchRequest req = new WikiSearchRequest("Albert Einstein");
req.Limit = 5; //We would like 5 results
WikiSearchResponse resp = await client.SearchAsync(req);
foreach (SearchResult s in resp.QueryResult.SearchResults)
{
Console.WriteLine($" - {s.Title}");
}
}
Output:
- Albert Einstein
- Hans Albert Einstein
- Einstein family
- Albert Brooks
- Albert Einstein College of Medicine