I want two api call one for content and the other one for language change.
1 Answers
Some experimentation shows that getting content links for one or more page titles, and specifying a required language for the content are part of the same API query. A specific language can be requested by providing a lllang
parameter in the query string with a suitable language code value.
For example to get the URL of a page with title "Albert Einstein" translated into Egyptian Arabic (code "arz") in the API's sandbox:
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=langlinks&titles=Albert+Einstein&llprop=url&lllang=arz
Depending on the application and query volumes, it can improve efficiency to request data for multiple titles and/or all languages in one call and search through the results, as opposed to making many separate, individual calls.
FWIW. The API documentation seems to lack instructions to provide specific parameters for a "langlinks` or other query types simply by adding them as key-value pairs to the query string.