Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get wordpress api data by language?

Let's say I have this api http://someUrlHere.com/wp-json/wp/v2/posts?categories=19&per_page=20 and I call it with GET method. How can I choose what language I want to receive the information? It should pe provided in 2 languages. Or how do I find out if it is provided only in English?

like image 858
Marian Enache Avatar asked Oct 12 '25 14:10

Marian Enache


1 Answers

Activate WPML Translation Management and then you must add

lang=en

as parameter to your call:

http://someUrlHere.com/wp-json/wp/v2/posts?categories=19&per_page=20&lang=en
like image 181
Sergio Gandrus Avatar answered Oct 16 '25 02:10

Sergio Gandrus