# README
Go API client for
The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program.
Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use.
SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used.
Category statistics are available for the previous thirteen months only.
See Statistics Overview for more information.
Overview
This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/sendgrid-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 1.0.0
- Package version:
- Build date: 2025-08-18T08:58:25.501579Z[Etc/UTC]
- Build package: com.sendgrid.oai.go.SendgridGoGenerator For more information, please visit https://support.sendgrid.com/hc/en-us
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import "./"
Documentation for API Endpoints
All URIs are relative to https://api.sendgrid.com
Class | Method | HTTP request | Description |
---|---|---|---|
GetClientStat | GetClientStat | Get /v3/clients/{ClientType}/stats | Retrieve stats by a specific client type. |
ListBrowserStat | ListBrowserStat | Get /v3/browsers/stats | Retrieve email statistics by browser. |
ListCategory | ListCategory | Get /v3/categories | Retrieve all categories |
ListCategoryStat | ListCategoryStat | Get /v3/categories/stats | Retrieve Email Statistics for Categories |
ListCategoryStatSum | ListCategoryStatSum | Get /v3/categories/stats/sums | Retrieve sums of email stats for each category. |
ListClientStat | ListClientStat | Get /v3/clients/stats | Retrieve email statistics by client type. |
ListDeviceStat | ListDeviceStat | Get /v3/devices/stats | Retrieve email statistics by device type. |
ListGeoStat | ListGeoStat | Get /v3/geo/stats | Retrieve email statistics by country and state/province. |
ListMailboxProviderStat | ListMailboxProviderStat | Get /v3/mailbox_providers/stats | Retrieve email statistics by mailbox provider. |
ListStat | ListStat | Get /v3/stats | Retrieve global email statistics |
Documentation For Models
- AdvancedStatsClicks
- AdvancedStatsClicksOpens
- AdvancedStatsMailboxProvider
- AdvancedStatsOpens
- AggregatedBy
- AggregatedBy1
- AggregatedBy2
- AggregatedBy3
- CategoryStats
- CategoryStatsStatsInner
- CategoryStatsStatsInnerMetrics
- ClientType
- Country
- ListBrowserStat200ResponseInner
- ListBrowserStat200ResponseInnerStatsInner
- ListCategory200ResponseInner
- ListCategory400Response
- ListCategory400ResponseErrorsInner
- ListClientStat200ResponseInner
- ListClientStat200ResponseInnerStatsInner
- ListGeoStat200ResponseInner
- ListGeoStat200ResponseInnerStatsInner
- ListMailboxProviderStat200ResponseInner
- ListMailboxProviderStat200ResponseInnerStatsInner
- ListStat200ResponseInner
- ListStat200ResponseInnerStatsInner
- SortByDirection
- StatsAdvancedGlobalStats
Documentation For Authorization
BearerAuth
- Type: HTTP basic authentication
Example
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)