How can I pass several pages in one request? Is it possible?
API talk:Langlinks
Appearance
Just add pipes between the page names. So, for example: https://www.mediawiki.org/w/api.php?action=query&prop=langlinks&titles=Mediawiki|API:Main%20page|Project:About&lllimit=500
Thank you. Not sure this is right place to report the bug, but. I make next query: https://ru.wikipedia.org/w/api.php?format=xml&action=query&prop=langlinks&lllimit=500&titles=1977%20%D0%B3%D0%BE%D0%B4%7C1988%20%D0%B3%D0%BE%D0%B4%7C1999%20%D0%B3%D0%BE%D0%B4 and it returns not all langlinks for 1988 year. It does no return "uk" langlink, although it is there.
Wikipedia limits the number of results returned for any given query. To get the rest of the results, look at the <continue> result near the top and add all those parameters to your next query. So, that ends up like this: https://ru.wikipedia.org/w/api.php?format=xml&action=query&prop=langlinks&lllimit=500&titles=1977%20%D0%B3%D0%BE%D0%B4%7C1988%20%D0%B3%D0%BE%D0%B4%7C1999%20%D0%B3%D0%BE%D0%B4&llcontinue=2715%7Cln&continue=%7C%7C
If there had been another <continue> in those results, then you'd put those values instead of the previous ones, but since there isn't, you know you're done.
Was that supposed to be on ru.wikipedia.org? Because if I do that, I get lllang results as expected.
Yes, that supposed to be articles from ruwiki.
Thank you.
Is it possible for a language code to have more than one language link? The current API help states that the lllang parameter causes the API to "only return language links with this language code". That "links" makes one think that the API may return multiple links for an individual language code, but I cant think of any situation or example that it would be the case.
I tried to manually add a language link to (different that the one that was already stored at wikidata), but it just overrode the previous language link and the API was still returning only one link.
Yup, there it is. If you look at Manual:Langlinks table, you'll see that the primary key ("PRI" in the Key column) is based on the page_id and the language link. Therefore, it's guaranteed that there can only ever be one result for a given language.
Nevermind, you already tried that. I didn't read closely enough. :) My guess is that it will probably only ever return one value, but that's just a guess. I don't see anything in the API that would preclude multiple language links being returned for the same language, but there could be something in how the table itself is populated that precludes it.
Is it possible to ask more than one language? e.g. return the intelanguage links for Italian and German
i tried this:
But it is not working
Thanks!
The parameter doesn't seem to be set up as a multi-input parameter. About the only way I can see of doing what you want is to drop the lllang
parameter altogether (and optionally add lllimit=500
), which will return all the language links. Then, you can filter those results to just French and Italian.
Thanks!
Is it possible to have the API return only language links defined in the source code, i.e. exclude language links obtained from WikiData? --~~~~
There are no older topics