ROLO
ROLO

Reputation: 581

How to get pageids releated to langlinks (or a subset) of a page in the English Wikipedia using MediaWiki API

i'm using this query to fetch all the langlinks from the english version of wikipedia having title "foo" and it works like a charm

/w/api.php?
action=query&
prop=langlinks&
format=xml&
llurl=&
lllang=it|fr
&titles=foo

but the result is a pain in the *

    "query": {
    "normalized": [
        {
            "from": "foo",
            "to": "Foo"
        }
    ],
    "pages": {
        "1234567": {
            "pageid": 1234567,
            "ns": 0,
            "title": "Foo",
            "langlinks": [
                {
                    "lang": "it",
                    "url": "http://it.wikipedia.org/wiki/Foo",
                    "*": "Foo"
                },
                {
                    "lang": "fr",
                    "url": "http://fr.wikipedia.org/wiki/Foo",
                    "*": "Foo"
                }
            ]
        }
    }

what i need here is prop=extracts on those urls both for the italian language and the french language, but without specific pageids for each url i'm not able to achieve that (or at least i don't know how to deal with it)

Upvotes: 2

Views: 514

Answers (1)

Related Questions