# Wikipedia APK to API example

Simpa Labs extracted three read-only request definitions from the official Wikipedia Alpha Android APK and rebuilt them as a Python client and a Postman collection.

This is an independent demonstration using Wikipedia’s public API. Wikimedia is not a client or endorser. The demo covers search, article extracts, and language links. It does not demonstrate login, request signing, or full-app coverage.

## Run the Python client

Requires Python 3.10 or later, with no extra packages.

```sh
python3 wikipedia_client.py
python3 wikipedia_client.py --query "Abuja"
python3 wikipedia_client.py --json
```

The client searches, takes the first result, reads its article extract, and retrieves its language links. It makes three read-only requests to en.wikipedia.org. It does not run or require an Android app, emulator, login, or API key.

## Run in Postman

Import `wikipedia.postman_collection.json`, then run the collection in order. Search sets the article title for the following requests. The collection includes 11 assertions checking HTTP status, API errors, and returned data.

## What was tested

On 9 September 2026, the Python client returned Lagos, Lagos State, and Lagos (disambiguation), an article extract for Lagos, and 167 language links. All three responses returned HTTP 200. The Postman collection passed all 11 assertions through Newman. Live content and result counts can change.

`python-verification.json` and `postman-verification.json` contain the recorded results. These are saved test results, not a live status monitor.

## APK and extraction

- App: Wikipedia Alpha, version 50605-alpha-2026-09-08 (version code 50605).
- Package: org.wikipedia.alpha.
- Official download: https://github.com/wikimedia/apps-android-wikipedia/releases/download/latest/app-alpha-universal-release.apk
- Extracted class: org.wikipedia.dataclient.Service.
- Tool: JADX 1.5.5.

`apk-evidence.json` contains the APK SHA-256 and the exact request paths and query parameters extracted from its Retrofit annotations. The official latest download changes over time; compare hashes before reproducing the extraction. No app source checkout was used.

The Python client was executed outside Android. This example does not claim an on-device comparison or traffic capture.

## Files

- wikipedia_client.py: runnable Python client.
- wikipedia.postman_collection.json: runnable Postman collection.
- apk-evidence.json: artifact identity and extracted request definitions.
- python-verification.json: recorded Python run.
- postman-verification.json: recorded Postman test summary.

Demo client and collection: MIT license, copyright 2026 Simpa Labs. Permission is granted to use, copy, modify, and distribute these demo files, with this notice. The software is provided as is, without warranty. Wikipedia content remains under its applicable Wikimedia licenses.
