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

  • SEARCH
  • Home
  • 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 6772821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:35:38+00:00 2026-05-26T15:35:38+00:00

I am developing a Twitter web app for myself. I am retrieving the latest

  • 0

I am developing a Twitter web app for myself. I am retrieving the latest trending topics.

Here’s how I’m doing it:

    $.ajax({
                      url: 'http://api.twitter.com/1/trends/1.json',
                      dataType: 'jsonp',
                       success: function(data){


                       $.each(data[0].trends, function(i){
                          $('div#trending').hide().append("<p><a href='"+data[0].trends[i].url+"'>"+data[0].trends[i].name+"</a></p>").fadeIn(1000);
                        //Cache into LocalStorage
                    localStorage["trending"+i] = data[0].trends[i].name; //Name
                    localStorage["trendurl"+i] = data[0].trends[i].url;//URL

                                });
                            }
});

But sometimes while I am developing it, the rate limit is exceeded.

How can I detect if the rate limit has been exceeded?

I cannot seem to detect if this error is being shown:

{"error":"Rate limit exceeded. Clients may not make more than 150 requests per hour.","request":"\/1\/trends\/1.json"}

I have tried it by:

success: function(data){
  if(data[0].error != 'undefined'){
    //load localstorage cache
  }
}

But that doesn’t seem to work.
Please help.

Thanks 🙂

  • 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-26T15:35:39+00:00Added an answer on May 26, 2026 at 3:35 pm

    The Twitter API sends a HTTP 400 status code when you are rate limited, so check for that:

    $.ajax({
        // ...
        statusCode: {
            400: function() {
                alert( 'rate limited.' );
            }
        }
    });
    

    Also note that your comparison is a bit wrong. data[0].error != 'undefined' will always yield true when the error text is not 'undefined'. So even when you are rate limited, the error text won’t be 'undefined' and as such succeed. What you probably want to check is this:

    if ( !data[0].error ) { // data[0].error is not null
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing Twitter API to my application. In my app, I want to
Developing a web application that I've registered with Twitter. In this app, I might
I'm developing a twitter messaging utility using Twitter API (twitterizer). But since I'm within
I'm developing an app that is vaguely similar to twitter, in that it allows
Quick question: Will KnockoutJS provide a solid ground for developing a large web app?
Any good source/website/inputs/sample to kickstart developing a twitter application using twitter API? Edit :
I'm using Twitter API with PHP, developing sort of tests. Those test are one
I'm currently working on an app that works with Twitter, but while developing/testing (especially
I am developing a web app that accesses some external JSON data. I'm currently
hi i am developing Twitter client on iPhone, here i am using MGTwitter library

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.