From 8c15d9cc5475e884a614843db08b229f4101f511 Mon Sep 17 00:00:00 2001 From: jnorris441 Date: Sat, 16 Nov 2013 11:16:27 -0600 Subject: [PATCH] Daily transaction limit /info/GetAPIKeyInfo tells you how many calls you have left and what your daily limit is. --- alchemyapi.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/alchemyapi.php b/alchemyapi.php index ccaea1f..53c6cf5 100644 --- a/alchemyapi.php +++ b/alchemyapi.php @@ -79,6 +79,7 @@ public function AlchemyAPI() { $this->_ENDPOINTS['feeds']['html'] = '/html/HTMLGetFeedLinks'; $this->_ENDPOINTS['microformats']['url'] = '/url/URLGetMicroformatData'; $this->_ENDPOINTS['microformats']['html'] = '/html/HTMLGetMicroformatData'; + $this->_ENDPOINTS['apikeyinfo']['info'] = '/info/GetAPIKeyInfo'; } @@ -495,7 +496,23 @@ public function microformats($flavor, $data, $options) { return $this->analyze($this->_ENDPOINTS['microformats'][$flavor], $options); } - + /** + * Gets information about an API Key, including the daily transaction limit and + * consumed transactions. + * + * INPUT: + * options -> various parameters that can be used to adjust how the API works, see below for more info on the available options. + * + * Available Options: + * none + * + * OUTPUT: + * The response, already converted from JSON to a PHP object. + */ + public function apikeyinfo($options) { + return $this->analyze($this->_ENDPOINTS['apikeyinfo']['info'], $options); + } + /** * HTTP Request wrapper that is called by the endpoint functions. This function is not intended to be called through an external interface. * It makes the call, then converts the returned JSON string into a PHP object.