Is lang operator working as intended?



I just purchased premium api access and right now trying to get it to work with the lang operator.

I am using endpoint<…and a valid label here>

Trying out a query that looks like “lang:sv (apple watch) OR tele2” just gives me results in any available language.

However … using a browser to search for it here:

works perfectly fine…

Am I missing something in the premium API call??


Hej @abstractitsthlm! I believe the issue is with the way you’re running the request. Could you send me your request (with keys/tokens redacted)?

Also, check out this Premium Search tutorial on how to quickly build and run a query using cURL or Twurl.



Hi @Hamza

This pretty much replicates the issue… just replace the environment and token placeholders.

curl --request POST \
  --url<ENV>.json \
  --header 'authorization: Bearer <TOKEN>' \
  --header 'content-type: application/json' \
  --data '{
                "query":"lang:sv tele2 OR (apple watch)",
                "maxResults": "100",

It is a bit unclear from the API documentation exactly how the query should be created in cases like this.
Especially since the query from above actually works perfectly fine on


Hmm, when I run the exact same query I’m able to successfully get the data I request, which leads me to believe the issue may be with your command line only displaying a certain amount of data. Have you tried to run the request with Postman or Insomnia?


Sorry, I am not sure if you understood my issue.
Did you check the data you got back? What languages are the posts marked as?
I do get get data back according the terms, however I get too much. I get tweets that are in English or other languages too, but I specified that I wanted only Swedish results. The lang operator doesn’t seem to work as I would have expected in this case.


@abstractitsthlm - can you try running the request (I modified the data field):

  --url<ENV>.json \
  --header 'authorization: Bearer <TOKEN>' \
  --header 'content-type: application/json' \
  --data '{
                "query":"(tele2 OR (apple watch)) lang:sv",
                "maxResults": "100",

This should work, but let me know if you have any issues.


One thing to note here is that the premium and enterprise search syntax is based on our PowerTrack query language, and is explicitly not the same as the query you can type on Broadly speaking the standard APi does support the website syntax, but the same does not apply on premium search endpoints.


yup, that is what I am using already since that gave me more relevant result.

Still would be great to have this clarified in the API docs…


Thank you for the feedback, @abstractitsthlm. Our goal is to make our documentation more accessible, and your feedback is always appreciated. :100:

closed #10

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.