{
  "info": {
    "name": "Simpa Labs \u2014 Wikipedia APK to API demo",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Three read-only requests extracted from Wikipedia Alpha APK 50605-alpha-2026-09-08. Run in order. Independent public demo; Wikimedia is not a client or endorser. See apk-evidence.json for APK identity and extraction details."
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://en.wikipedia.org"
    },
    {
      "key": "query",
      "value": "Lagos"
    },
    {
      "key": "article_title",
      "value": "Lagos"
    }
  ],
  "item": [
    {
      "name": "Search articles",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "User-Agent",
            "value": "SimpaLabs-APK-Demo/1.0 (https://www.simpalabs.com; security@simpalabs.com)"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/w/api.php?format=json&formatversion=2&errorformat=html&errorsuselocal=1&action=query&converttitles=&prop=description|pageimages|pageprops|coordinates|info&ppprop=mainpage|disambiguation&generator=search&gsrnamespace=0&gsrwhat=text&inprop=varianttitles|displaytitle&gsrinfo=&gsrprop=redirecttitle&piprop=thumbnail&pilicense=any&pithumbsize=330&gsrsearch={{query}}&gsrlimit=3"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"HTTP 200\", () => pm.response.to.have.status(200));",
              "const body = pm.response.json();",
              "pm.test(\"No API error\", () => { pm.expect(body).not.to.have.property(\"error\"); pm.expect(body).not.to.have.property(\"errors\"); });",
              "pm.test(\"Pages returned\", () => pm.expect(body.query.pages).to.be.an(\"array\").that.is.not.empty);",
              "const pages = body.query.pages.slice().sort((a,b) => a.index - b.index);",
              "pm.collectionVariables.set(\"article_title\", pages[0].title);"
            ]
          }
        }
      ]
    },
    {
      "name": "Read article",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "User-Agent",
            "value": "SimpaLabs-APK-Demo/1.0 (https://www.simpalabs.com; security@simpalabs.com)"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/w/api.php?format=json&formatversion=2&errorformat=html&errorsuselocal=1&action=query&prop=info|description|pageimages|extracts&exchars=500&exintro=1&explaintext=1&pilicense=any&inprop=varianttitles|displaytitle&redirects=1&pithumbsize=330&titles={{article_title}}"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"HTTP 200\", () => pm.response.to.have.status(200));",
              "const body = pm.response.json();",
              "pm.test(\"No API error\", () => { pm.expect(body).not.to.have.property(\"error\"); pm.expect(body).not.to.have.property(\"errors\"); });",
              "pm.test(\"Pages returned\", () => pm.expect(body.query.pages).to.be.an(\"array\").that.is.not.empty);",
              "pm.test(\"Article extract returned\", () => pm.expect(body.query.pages[0].extract).to.be.a(\"string\").that.is.not.empty);"
            ]
          }
        }
      ]
    },
    {
      "name": "Get languages",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "User-Agent",
            "value": "SimpaLabs-APK-Demo/1.0 (https://www.simpalabs.com; security@simpalabs.com)"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{base_url}}/w/api.php?format=json&formatversion=2&errorformat=html&errorsuselocal=1&action=query&prop=langlinks&lllimit=500&redirects=&converttitles=&titles={{article_title}}"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"HTTP 200\", () => pm.response.to.have.status(200));",
              "const body = pm.response.json();",
              "pm.test(\"No API error\", () => { pm.expect(body).not.to.have.property(\"error\"); pm.expect(body).not.to.have.property(\"errors\"); });",
              "pm.test(\"Pages returned\", () => pm.expect(body.query.pages).to.be.an(\"array\").that.is.not.empty);",
              "pm.test(\"Language links returned\", () => pm.expect(body.query.pages[0].langlinks).to.be.an(\"array\").that.is.not.empty);"
            ]
          }
        }
      ]
    }
  ]
}
