PhpRiot
Follow phpriot on Twitter
Sponsored Link
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store
Free iPad/iPhone App
Available on the App Store

  • PHP manual
  • Zend Framework manual
  • Smarty manual
  • PHP articles
  • PHP training

Checking Your API Key Daily Usage

From time to time you probably will want to check your API key daily usage. By default Technorati limits your API usage to 500 calls per day, and an exception is returned by Zend_Service_Technorati if you try to use it beyond this limit. You can get information about your API key usage using the Zend_Service_Technorati::keyInfo() method.

Zend_Service_Technorati::keyInfo() returns a Zend_Service_Technorati_KeyInfoResult object. For full details please see the API reference guide.

Example 829. Getting API key daily usage information

<?php
$technorati 
= new Zend_Service_Technorati('VALID_API_KEY');
$key $technorati->keyInfo();

echo 
"API Key: " $key->getApiKey() . "<br />";
echo 
"Daily Usage: " $key->getApiQueries() . "/" .
     
$key->getMaxQueries() . "<br />";

Zend Framework