Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3797954
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:29:32+00:00 2026-05-19T13:29:32+00:00

For a user profile i query the Twitter Search API via: curl_setopt($ch, CURLOPT_URL, http://search.twitter.com/search.rss?q=.urlencode($username.+-badword).);

  • 0

For a user profile i query the Twitter Search API via:

curl_setopt($ch, CURLOPT_URL, "http://search.twitter.com/search.rss?q=".urlencode($username."+-badword")."");

which worked excellent the last weeks.

Since a few days the Twitter API gets a lot of requests from my site and sometimes responses with a “406 Not Acceptable”

the complete error message is:

array(18) { [0]=> string(27) “HTTP/1.1 406 Not Acceptable” [1]=> string(35) “Date: Fri, 21 Jan 2011 12:31:06 GMT” [2]=> string(10) “Server: hi” [3]=> string(26) “Status: 406 Not Acceptable” [4]=> string(15) “Retry-After: 10” [5]=> string(30) “X-Served-From: slc1-aah-25-sr1” [6]=> string(38) “Content-Type: text/html; charset=utf-8” [7]=> string(45) “X-Served-By: slc1-acm-32-sr1.prod.twitter.com” [8]=> string(55) “Cache-Control: max-age=15, must-revalidate, max-age=300” [9]=> string(38) “Expires: Fri, 21 Jan 2011 12:36:06 GMT” [10]=> string(21) “Vary: Accept-Encoding” [11]=> string(17) “Content-Length: 1” [12]=> string(21) “X-Varnish: 1897557299” [13]=> string(6) “Age: 0” [14]=> string(16) “Via: 1.1 varnish” [15]=> string(45) “X-Cache-Svr: slc1-acm-32-sr1.prod.twitter.com” [16]=> string(13) “X-Cache: MISS” [17]=> string(17) “Connection: close” }

I don’t understand the Twitter Doku about this:

http://apiwiki.twitter.com/w/page/22554652/HTTP-Response-Codes-and-Errors says “406 Not Acceptable: Returned by the Search API when an invalid format is specified in the request.”

because, when i retry after a few seconds the request works fine again.

Who has an idea how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:29:33+00:00Added an answer on May 19, 2026 at 1:29 pm

    Reason:
    From the docs, the supported formats are:

    1) json
    2) atom

    And you’re using rss. That’s why you’re getting the error. The format has to be specified as the extension. Like this:

    http://search.twitter.com/search.format
    

    Solution:
    Use atom or json format, like this:

    http://search.twitter.com/search.json?q=twitter
    

    Full code should look like:

    curl_setopt($ch, CURLOPT_URL, "http://search.twitter.com/search.json?q=".urlencode($username."+-badword")."");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i need to use https://api.facebook.com/method/fql.query?query= to get user profile picture and other user
On my site, user profiles can be reached by the url www.example.com/user/profile.php?uid=3 I want
Two models (Rails 2.3.8): User; username & disabled properties; User has_one :profile Profile; full_name
I successfully integrate the face-book API and able to get all user profile but
I am pulling back some data from the twitter query API, and parsing it
I was following this tutorial on how to parse twitter search api requests with
I have a user profile page on my web app which has contact information.
I'm very confused about the whole user profile thing in drupal, hope someone can
Hello I am trying to get the user profile picture and then merge into
now I can make it work with user-profile.tpl.php page,all this page does is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.