Request limits / usage reporting / is this a problem? RRS feed

  • Question

  • I want to know if there is a problem with my approach here.  I'm using the free license and don't anticipate even approaching 50,000 requests per day.  It's a non-profit site that I imagine will only be used up to 100 times per day, and that would be an extraordinary day.  I am using the REST geocoder, but as someone else recently mentioned the REST geocoding API fails to return a valid result maybe 1/3 of the time.  

    My approach to handling the 1/3 was to put the API call inside of a while loop that would keep repeating until a valid result was received, set to time out after 10 seconds.   My more-experienced developer friend said this might be considered a shenanigan, and might cause problems, up to and including having Bing deny service!  Yikes.  

    So my question is - what do you see as being the potential downsides to this approach?  Is it likely to put me over my 50,000 request per day limit?  Also, off the top of your head can you recommend a better way of dealing with the 1/3 failures?   I'm only getting started on this project and don't want to abuse the service, I just want to make it so users only have to enter their address once.

    Friday, November 16, 2012 4:14 PM


  • What you can do is get the response header from your REST request and check to see if it has a property called "X-MS-BM-WS-INFO" and if this property is set to 1. If it is then it means your request was rate limited. When your request is rate limited you can set up a timeout to remake the request after a period of time. If you were to base the timeout one an empty request you could potential find yourself in an recursive loop.

    All that said, based on your use case I don't suspect the rate limiting will be an issue for your application. It's more so meant to slow down those who hammer the servers with 1,000's of requests in a short period of time as those types of applications typically require a license.

    • Marked as answer by Patrick Noonan Friday, November 16, 2012 5:45 PM
    Friday, November 16, 2012 4:40 PM