Thank you! Your feedback helps us improve.

Analytics API Developer Guide

Who has access: Grammarly Enterprise and Grammarly for Education customers

The Analytics API offers organizations a programmatic way to obtain Grammarly usage data and integrate it directly into their business intelligence (BI) systems. This allows organizations to tie the data to key business outcomes and measure Grammarly’s impact more effectively.

Getting started with the Analytics API

The Analytics API is included in Grammarly Enterprise and Grammarly for Education plans.

Interested in upgrading to an Enterprise account? Contact our Sales team.

The API is intended for programmatic consumption and is accessible through an HTTP REST interface. Access to the API requires authentication using an Access Token provided by Grammarly’s OAuth functionality.

Admins can create a Client ID and a Client Secret on the appropriate page of their Admin panel. For more information on managing OAuth credentials, please review this article: Receive OAuth 2.0 credentials

Accessing the Analytics API

Get analytics for users

GET https://api.grammarly.com/ecosystem/api/v2/analytics/users

This API endpoint retrieves a paginated list of users associated with a Grammarly team plan. Each user object in the response includes the user ID and Grammarly usage statistics.

The scope required for the Access Token is analytics-api:read.

Request parameters

Parameter Type Required Description
date_from String Yes Start date for filtering user statistics in the YYYY-MM-DD format. The earliest supported start date is one year prior to the current date.
date_to String Yes End date for filtering user statistics in the YYYY-MM-DD format. The latest supported date is two days before the current date.
cursor String No Marker to paginate through large data sets. No cursor is required for the initial request. If additional pages are available, the response will contain a next_cursor value, which should be used as the cursor value in the subsequent request.
limit Integer No Limit on the number of returned entries. The maximum value is 400. Must be a positive number.

 

Request example

An example of a cURL request to get Grammarly usage data for the first 10 users:

curl -X GET \
'https://api.grammarly.com/ecosystem/api/v2/analytics/users?limit=10&date_from=2024-10-19&date_to=2024-10-22' \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response format

The response is a JSON object that includes an array of data objects and a paging object responsible for paging operations.

Response parameters

Parameter Type Description
data Array An array of user objects containing user statistics details.
paging Object API paging object.

 

Each user object in the data array has the following structure:

Field Type Description
id Integer Unique user identifier.
name String User name.
email String User email address.
days_active Integer The number of days a team member actively used Grammarly within the specified date range.
sessions_count Integer The number of writing sessions that took place during the specified date range. A writing session occurs when a team member uses Grammarly to actively write or edit text. A session automatically ends after 30 minutes of inactivity.
sessions_improved_percent Float The percentage of writing sessions that were improved out of writing sessions that had at least one error and took place during the selected date range. A writing session is considered improved if there are fewer mistakes in the text at the end of a session than at the beginning.
prompt_count Integer The number of generative AI prompts used by a team member within the date range.

 

The paging object has the following structure:

Field Type Description
next_cursor String An encoded cursor that is used to fetch the next set of results, if available. It will not be returned if no more data is available.
cur_cursor String The cursor from the client request, if specified.
has_more Boolean Indicates whether there are additional records available in the database.
page_size Integer Number of items included in the data array in the current response.

 

Response example

An example of a response body:

{
   "data": [
      {
       "id": 0001,
       "name": "Jaiden",
       "email": "jaiden@acmeco.com",
         "days_active": 1,
         "sessions_count": 2,
         "prompt_count": 3,
       "sessions_improved_percent": 50.00
      }
   ],
   "paging": {
         "next_cursor": "MTI=",
         "cur_cursor": "xyZ",
         "has_more": true,
         "page_size": 1
   }
}

Data availability

The data is accessible for 365 days prior, with a two-day lag from the current date. For example, if you make a request on November 1, 2024, the valid date range for date_from and date_to would be between October 30, 2023 and October 30, 2024.

Was this article helpful?
Tell us what you think. We promise to act on your feedback to make Grammarly's support pages even more helpful.
Have more questions? Submit a request
API