Jump to content

Topic on API talk:Langlinks

Several pages in one request

7
Alex Blokha (talkcontribs)

How can I pass several pages in one request? Is it possible?

RobinHood70 (talkcontribs)

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

Alex Blokha (talkcontribs)
RobinHood70 (talkcontribs)

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.

Alex Blokha (talkcontribs)

Ok, I am trying to get this url https://uk.wikipedia.org/w/api.php?format=xml&action=query&prop=langlinks&lllang=uk&lllimit=500&titles=%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F%20%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0%7C%D0%9A%D0%BE%D1%80%D0%BE%D0%BD%D0%B0%D0%B2%D0%B8%D1%80%D1%83%D1%81%D1%8B%7C%D0%9C%D0%B0%D0%BB%D0%B8%D0%BA%D0%BE%D0%B2%2C%20%D0%94%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9%20%D0%AE%D1%80%D1%8C%D0%B5%D0%B2%D0%B8%D1%87%7C%D0%92%D1%81%D0%BF%D1%8B%D1%88%D0%BA%D0%B0%20%D0%BA%D0%BE%D1%80%D0%BE%D0%BD%D0%B0%D0%B2%D0%B8%D1%80%D1%83%D1%81%D0%B0%202019-nCoV%7C%D0%9B%D0%B5%D1%89%D0%B5%D0%BD%D0%BA%D0%BE%2C%20%D0%9B%D0%B5%D0%B2%20%D0%92%D0%B0%D0%BB%D0%B5%D1%80%D1%8C%D1%8F%D0%BD%D0%BE%D0%B2%D0%B8%D1%87%7C%D0%95%D0%B2%D1%80%D0%BE%D0%BF%D0%B5%D0%B9%D1%81%D0%BA%D0%B8%D0%B9%20%D1%81%D0%BE%D1%8E%D0%B7%7C%D0%A5%D0%B0%D0%BD%D0%B3%D0%B0%2C%20%D0%95%D0%BB%D0%B5%D0%BD%D0%B0%20%D0%90%D0%B1%D0%B4%D1%83%D0%BB%D0%B0%D0%B5%D0%B2%D0%BD%D0%B0%7C%D0%9A%D0%B5%D0%BD%D0%B8%D0%BD%2C%20%D0%A1%D0%BE%D1%84%D0%B8%D1%8F%7C%D0%92%D1%8B%D1%85%D0%BE%D0%B4%20%D0%92%D0%B5%D0%BB%D0%B8%D0%BA%D0%BE%D0%B1%D1%80%D0%B8%D1%82%D0%B0%D0%BD%D0%B8%D0%B8%20%D0%B8%D0%B7%20%D0%95%D0%B2%D1%80%D0%BE%D0%BF%D0%B5%D0%B9%D1%81%D0%BA%D0%BE%D0%B3%D0%BE%20%D1%81%D0%BE%D1%8E%D0%B7%D0%B0%7C%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA%20%D0%B8%D0%B3%D1%80%D0%BE%D0%BA%D0%BE%D0%B2%20%D0%9D%D0%A5%D0%9B%2C%20%D0%B7%D0%B0%D0%B1%D1%80%D0%BE%D1%81%D0%B8%D0%B2%D1%88%D0%B8%D1%85%20500%20%D0%B8%20%D0%B1%D0%BE%D0%BB%D0%B5%D0%B5%20%D1%88%D0%B0%D0%B9%D0%B1%7C

And I can see both pages, which have uk interwiki and which don't have. I use 'lllang' parametr.

RobinHood70 (talkcontribs)

Was that supposed to be on ru.wikipedia.org? Because if I do that, I get lllang results as expected.

Alex Blokha (talkcontribs)

Yes, that supposed to be articles from ruwiki.

Thank you.

Reply to "Several pages in one request"