The Wikipedia Game API is an API that determines the path between two Wikipedia articles by following their links. This tool uses Breadth-First Search (BFS) to traverse through the links on Wikipedia pages, starting from a given 'start' page until it reaches the desired 'end' page. You can visualize it as the shortest path between two Wikipedia articles based purely on their links.
- 🚀 Utilizes BFS for shortest path detection between Wikipedia articles.
- 📜 Returns a list of Wikipedia article titles that constitute the path between the starting and ending URL.
- 🔥 Easily deployable Flask application.
- 🕸️ Built-in support for BeautifulSoup to parse web content.
Fetch the shortest path between two Wikipedia articles using their links.
Parameters:
start_url
: The full Wikipedia URL from where the search begins.end_url
: The full Wikipedia URL where the search ends.
Response:
- A list of Wikipedia article titles from
start_url
toend_url
, representing the path.
This API was deployed to a simple Debian server. You can try the live version of this tool at http://45.33.125.208:5000/query?start_url=[start_url]&end_url=[end_url].
- Clone the repository.
git clone https://github.com/ShahRishi/wikipedia-game-api.git
cd wikipedia-game-api
- Set up a virtual environment (optional)
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the required packages.
pip install -r requirements.txt
- Run API
python3 app.py