The Usage API is a free REST API that provides programmatic access and visibility into activity consumption across products for your account. It is the most important and best tool for helping to monitor and manage usage across the different APIs under your account.
public function get() : mixed
This call retrieves the API usage for current month.
This call returns an API usage object, and returns an APIException otherwise.
The usage object has the following fields:
|geoip_requests||number||The number of Geolocation API requests used in the current month|
|mail_requests||number||The number of Mail API requests used in the current month|
<?php use Objectia\Client; $apiKey = $_ENV["OBJECTIA_APIKEY"] $client = new Client($apiKey); $usage = $client->usage->get(); echo "Number of GeoLocation requests: " . $usage["geoip_requests"]; echo "Number of Mail requests: " . $usage["mail_requests"];