# Get usage stats GET https://api2.freecustom.email/v1/usage Returns live usage stats for the current billing period. Reference: https://docs.freecustom.email/free-custom-email-api/v-1/usage/get-usage-stats ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /v1/usage: get: operationId: get-usage-stats summary: Get usage stats description: Returns live usage stats for the current billing period. tags: - subpackage_v1.subpackage_v1/usage parameters: - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/v1_usage_Get usage stats_Response_200' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/GetV1UsageRequestUnauthorizedError' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/GetV1UsageRequestTooManyRequestsError' servers: - url: https://api2.freecustom.email components: schemas: V1UsageGetResponsesContentApplicationJsonSchemaDataPeriod: type: object properties: month: type: string resets_at: type: string format: date-time required: - month - resets_at title: V1UsageGetResponsesContentApplicationJsonSchemaDataPeriod V1UsageGetResponsesContentApplicationJsonSchemaDataRequests: type: object properties: used: type: integer limit: type: integer remaining: type: integer percent_used: type: number format: double required: - used - limit - remaining - percent_used title: V1UsageGetResponsesContentApplicationJsonSchemaDataRequests V1UsageGetResponsesContentApplicationJsonSchemaDataCredits: type: object properties: balance: type: integer note: type: string required: - balance - note title: V1UsageGetResponsesContentApplicationJsonSchemaDataCredits V1UsageGetResponsesContentApplicationJsonSchemaDataRateLimit: type: object properties: requests_per_second: type: integer required: - requests_per_second title: V1UsageGetResponsesContentApplicationJsonSchemaDataRateLimit V1UsageGetResponsesContentApplicationJsonSchemaData: type: object properties: plan: type: string period: $ref: >- #/components/schemas/V1UsageGetResponsesContentApplicationJsonSchemaDataPeriod requests: $ref: >- #/components/schemas/V1UsageGetResponsesContentApplicationJsonSchemaDataRequests credits: $ref: >- #/components/schemas/V1UsageGetResponsesContentApplicationJsonSchemaDataCredits rate_limit: $ref: >- #/components/schemas/V1UsageGetResponsesContentApplicationJsonSchemaDataRateLimit required: - plan - period - requests - credits - rate_limit title: V1UsageGetResponsesContentApplicationJsonSchemaData v1_usage_Get usage stats_Response_200: type: object properties: success: type: boolean data: $ref: >- #/components/schemas/V1UsageGetResponsesContentApplicationJsonSchemaData required: - success - data title: v1_usage_Get usage stats_Response_200 GetV1UsageRequestUnauthorizedError: type: object properties: success: type: boolean error: type: string message: type: string required: - success - error - message title: GetV1UsageRequestUnauthorizedError GetV1UsageRequestTooManyRequestsError: type: object properties: success: type: boolean error: type: string message: type: string upgrade_url: type: string format: uri credits_url: type: string format: uri hint: type: string required: - success - error - message - upgrade_url - credits_url - hint title: GetV1UsageRequestTooManyRequestsError securitySchemes: bearerAuth: type: http scheme: bearer ``` ## SDK Code Examples ```python v1_usage_Get usage stats_example import requests url = "https://api2.freecustom.email/v1/usage" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript v1_usage_Get usage stats_example const url = 'https://api2.freecustom.email/v1/usage'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go v1_usage_Get usage stats_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api2.freecustom.email/v1/usage" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby v1_usage_Get usage stats_example require 'uri' require 'net/http' url = URI("https://api2.freecustom.email/v1/usage") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java v1_usage_Get usage stats_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api2.freecustom.email/v1/usage") .header("Authorization", "Bearer ") .asString(); ``` ```php v1_usage_Get usage stats_example request('GET', 'https://api2.freecustom.email/v1/usage', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp v1_usage_Get usage stats_example using RestSharp; var client = new RestClient("https://api2.freecustom.email/v1/usage"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift v1_usage_Get usage stats_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api2.freecustom.email/v1/usage")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```