Help Requests

Requests or (requests per minute) is how many requests per minute a single "host" or user can make. If you are allotted 100000 queries per day, and you are limited to 20 requests per minute, here are some scenarios that might explain what it means:

Examples:

  • You have 1000 subscribers, each could make the call 100 times in a day
    • 1000 subscribers * 100 API calls = 100000 total API calls.
  • You have 100 subscribers, each could make the api call 1000 times in a day
    • 100 subscribers * 1000 API calls = 100000 total API calls.
  • Each host can only use the API 20 times in 1 minute or once every 3 seconds.

Let's say you have 1000 users, each making calls to the API, they will all be bound by your plan limitations. If your plan allows 20 calls per minute, and just 1 of your users hits the API 21 times in a minute then that 1 user will have an error returned, and the block to that user will not affect the other 999 users. The retry wait time is 1 minute before the block is removed.

Help JSON

Here is a code snippet to help you setup a JSON request.
As this is server request these kind of requests can impact RPMPH more.
If you need more RPM send us an email and we can work something out.

<?php 
    $url = 'https://geo.c-w-services.com/api/v1/zipcode/json?zipcode=74301&api_token=[Your API Token]';
    $results = json_decode(file_get_contents($url));
?>

Help JSONP

Here is a code snippet to help you setup JSONP requests.
If you have a lot of different "Users" then JSONP is how you should use this service. 100 different users/hosts accesing the API at once they will not count as the RPMPH are per host.

<script type="text/javascript">
function jsonCallback( json ) {
     //console.log( json ); // server response
    $('input[name="city"]').val(json.city);
    $('input[name="state"]').val(json.state_prefix);
}

$('input[name="zipcode"]').change(function() {
    var _Zipcode = $(this).val();

    $.ajax({
        // URL of the API request if no callback is specified the default is callback
        url: "https://geo.c-w-services.com/api/v1/zipcode/jsonp?callback=?",

        // The name of your callback parameter, if you do not specify a callback the default is "callback"
        jsonpCallback: "jsonCallback",

        // Tell jQuery we're expecting JSONP
        dataType: "jsonp",

        // Pass parameters in the request 
        data: {
            zipcode: _Zipcode,
            api_token: "[Your API Key Here]"
        }
    });
});
</script>    

Help XML

Here is a code snippet to help you setup a XML request.
As this is a server request these kind of requests can impact RPMPH more.
If you need more RPM send us an email and we can work something out.

<?php 
    $url = 'https://geo.c-w-services.com/api/v1/zipcode/xml?zipcode=74104&api_token=[Your API Token';
    $myXMLData = file_get_contents($url);
    $dataObj = simplexml_load_string($myXMLData) or die($myXMLData);
    echo "<pre>";
    print_r($dataObj);
    echo "Lat: {$dataObj->location->lat}\n";
    echo "Lon: {$dataObj->location->lon}\n";
?>