DEV Community

Алексей Спинов
Алексей Спинов

Posted on

Wikipedia API: Get Market Overviews for Any Industry in Seconds

Wikipedia's API is one of the most underrated data sources. Free, fast, no auth — and it covers virtually every industry.

Search Any Topic

curl 'https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=electric+vehicles&format=json&srlimit=5'
Enter fullscreen mode Exit fullscreen mode

Returns: page titles, snippets, word counts, timestamps.

Get Page Content

curl 'https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&titles=Electric_vehicle&format=json'
Enter fullscreen mode Exit fullscreen mode

Node.js Example

async function wikiSearch(query, limit = 5) {
  const url = `https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${encodeURIComponent(query)}&format=json&srlimit=${limit}&origin=*`;
  const res = await fetch(url);
  const data = await res.json();

  return data.query.search.map(r => ({
    title: r.title,
    snippet: r.snippet.replace(/<[^>]+>/g, ''),
    wordcount: r.wordcount,
    url: `https://en.wikipedia.org/wiki/${r.title.replace(/ /g, '_')}`
  }));
}

const results = await wikiSearch('artificial intelligence startups');
console.table(results);
Enter fullscreen mode Exit fullscreen mode

Multi-Language Support

Replace en with any language code:

  • ru.wikipedia.org — Russian
  • zh.wikipedia.org — Chinese
  • es.wikipedia.org — Spanish
  • fr.wikipedia.org — French

This is powerful for international market research.

Use Cases

  1. Market overview — what does Wikipedia say about your industry?
  2. Competitive landscape — who are the major players?
  3. Industry definitions — standardized terminology and metrics
  4. Historical context — industry timeline and milestones

I use Wikipedia as the first of 9 data sources in my market research tool.

More Free APIs


Need market research for your industry? $20 — any industry, 9 data sources, delivered in 24h. Email: Spinov001@gmail.com | Hire me

Top comments (0)