Search/tweets.json api don't give any response for special charater

restapi
android
api

#1

I am using “search/tweets.json” api.

I get result for simple character like https://api.twitter.com/1.1/search/tweets.json?q=%23Test

but if i add special chratcter like https://api.twitter.com/1.1/search/tweets.json?q=%23test@#*

Then api gives null response.

Please suggest what is wrong in api call.

Waiting for the response.

Thanks & Regards
Twitter user


#2

encode the special characters, for example in php it’d be:

urlencode("#Test@#*")

I’m not sure if that’s the only issue but it’s a good starting point.


#3

Hello DanielCHood,

Can you please suggest how you encode string???


#4

I have add 1 line while sending api request,

Before calling api, Change search Teg in URLEncode,

URLEncoder.encode(“Search String”, “UTF8”);

That’s it, Now twitter gives search result in special character also.


#5

The line of code I provided was for php. You didn’t specify the language you were using before.

Judging by your last post, can I assume you fixed it by encoding it or is it still not working after you used the

URLEncoder.encode(“Search String”, “UTF8”);

line?


#6

Hello DanielCHood,

I am working on android application so the language used is JAVA,

Twitter api gives proper response after encoding the search string.