What about the JSON format response is invalid for you? Is there a specific character appearing that your environment cannot consume? Can you share the since_id and max_id values that would help me find if it’s a specific tweet causing this?
Please keep in mind that the Twitter search API doesn’t accept count values greater than 100. Also make sure you’re using authentication to connect.