Forum Academy Marketplace Showcase Pricing Features

Wikipedia Content

Is there a way to input information into a field then clicking enter and having content (from wikipedia) that relates to the input information populate a repeating groupt or text element?

Wikipedia has an API. Its fairly straightforward to implement. Just a couple of GET calls using the bubble api connector.

You probably want to use two endpoints for this. Search API then Parse API. Search to find your article, and parse to display it.

https://www.mediawiki.org/wiki/API:Search

https://www.mediawiki.org/wiki/API:Get_the_contents_of_a_page

Example

Part 1 - Search the text

Below is the HTTP query you’d use to search for "bubble programming". This query returns JSON of the search results. You can parse the results using the bubb,e API connector. The first result is the wikipedia page for Bubble (Programming Language) and the pageId for that page .

https://en.wikipedia.org/w/api.php?action=query&list=search&srwhat=text&srsearch=bubble%20programming&format=json
Live Link vv

Part 2 - Get the page data

Assuming the first search result is always the one you want to display, then you can fetch the article information using the pageId retreived from your search in this case 50743880

https://en.wikipedia.org/w/api.php?action=parse&format=json&pageid=50743880&prop=wikitext&formatversion=2

Live Link vv

2 Likes

Thank you, jon2. Appreciate the help. Not saying I can do all this from the start, but you’ve put me on the right path.