Bitcoin Forum

Bitcoin => Project Development => Topic started by: fascistmuffin on June 19, 2011, 07:10:15 AM



Title: JSON Pull Interval Time
Post by: fascistmuffin on June 19, 2011, 07:10:15 AM
Any input on what the ideal time in between JSON pulls from sites should be? Right now I have mine app running at 60,000 milliseconds, which seems reasonable, but I'm not too sure if this interval is too taxing on the web service. Any good practices to consider while hitting a JSON web service frequently?


Title: Re: JSON Pull Interval Time
Post by: weex on June 19, 2011, 07:24:29 AM
What kind of application are we talking about here?

Short of knowing that, it's best to pull only as often as you need so that you won't miss data or be too slow to be useful.

When in doubt try to contact the site and mention what you're trying to do. They may be able to provide data optimized to your need and in a more efficient way for them to deliver.

Having run web services I can say it's also nice to be able to contact whomever is doing the polling so adding some form of contact info in your Useragent string is a nice courtesy. This is all kind of common sense stuff but saves everyone a lot of time and energy.


Title: Re: JSON Pull Interval Time
Post by: fascistmuffin on June 19, 2011, 07:35:24 AM
Right now my app is a .Net forum pulling stats from mtgox.

I'm pull the data from their API page http://mtgox.com/code/data/ticker.php (http://mtgox.com/code/data/ticker.php) here. Not too sure about the useragent string thing. Sorry, I'm a noob at web based development  :-\.


Title: Re: JSON Pull Interval Time
Post by: ahihi on June 19, 2011, 08:25:19 AM
Since you're pulling from Mt. Gox, you may want to consider using their WebSocket API (http://forum.bitcoin.org/index.php?topic=5855.0) instead of doing periodical requests. That way, they push the data to you in (more or less) real time! :)