Does the REST API support special latin characters? No matter what I do, it doesn’t seem to, although it really should given the website Twitter search does so.
For example, say I want to search for accounts related to my football club São Paulo.
In the twitter website, the address https://twitter.com/search?f=users&q=S%C3%A3o%20Paulo is perfectly valid and returns the expected list of results
Using the REST API, the equivalent search would be
https://api.twitter.com/1.1/users/search.json?q=S%C3%A3o%20Paulo. However, this does not work for me. The API returns a 401 HTTP status code and a 32 error code “could not authenticate you”. Please note this is the exact same search term that was used for the website search. (Calling
https://api.twitter.com/1.1/users/search.json?q=São%20Paulowithout escaping the special character leads to the exact same results)
This behaviour occurs only when there are special latin characters in the search term. For instance, I am able to search for another football club “Corinthians” through the API using the call
https://api.twitter.com/1.1/users/search.json?q=Corinthiansand get the correct results. The same goes for any search terms without special latin characters that need to be URL escaped; these are always successful and return the expected results. This is not an OAuth problem.
My questions are:
Is there a way to search for terms including special Latin characters through the API?
If not, why not? Surely the search functions behind the website search and the API should be equivalent? Is this a bug? Is it something the Twitter team could fix?
Thanks in advance,