Usage API

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.

Get usage

func (client *Usage) Get() (*APIUsage, error)

Retrieves the API usage for current month.

Arguments

None

Returns

This call returns an APIUsage object and an Error object.

Example

package main

import (
	"fmt"
	"github.com/objectia/objectia-go"
)

func main() {
    apiKey := "your-api-key"
	client, err := objectia.NewClient(apiKey, nil)

	var result *objectia.APIUsage
	result, err = client.Usage.Get()
	if err != nil {
		panic("Failed to get API usage")
	}
	fmt.Println("Number of GeoLocation requests:", result.GeoLocationRequests)
}