Metrics API
Use these endpoints to pull aggregate metrics per group or participant.
Get Number of Group Sessions
GET /metrics/groups/{groupID}/count
Get the number of sessions for a group.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
groupID
(required): The group ID of the group you want to view the count of.
Query String Parameters
from
(optional): The start date for the range of sessions to count. Format:YYYY-MM-DD
.to
(optional): The end date for the range of sessions to count. Format:YYYY-MM-DD
.groupBy
(optional): The time period to group the sessions by. Options:day
,week
,month
.
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/metrics/groups/123456/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());
import requests
requests.get("https://api.okaya.me/metrics/groups/123456/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
headers={
"x-api-key": "YOUR_API_KEY"
},
).json()
curl --location "https://api.okaya.me/metrics/groups/123456/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day" \
--header "x-api-key: YOUR_API_KEY"
Example Response
200
- No grouping
- Group by day or week
- Group by month
{
"all": 10
}
{
"2024-01-01": 10,
"2024-02-02": 10
}
{
"2024-01": 10,
"2024-02": 10
}
400
- Invalid 'groupID'
- Invalid 'from'
- Invalid 'to'
- Invalid 'groupBy'
{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }
{ "error": "Invalid 'from' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'to' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'groupBy' value. Should be one of ['day', 'week', 'month']." }
401: Unauthorized
Get MHCI Metrics for a Group
GET /metrics/groups/{groupID}/mhci
Get MHCI metrics for a group.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
groupID
(required): The group ID of the group you want to view the count of.
Query String Parameters
from
(optional): The start date for the range of sessions to count. Format:YYYY-MM-DD
.to
(optional): The end date for the range of sessions to count. Format:YYYY-MM-DD
.groupBy
(optional): The time period to group the sessions by. Options:day
,week
,month
.
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/metrics/groups/123456/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());
import requests
requests.get("https://api.okaya.me/metrics/groups/123456/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
headers={
"x-api-key": "YOUR_API_KEY"
},
).json()
curl --location "https://api.okaya.me/metrics/groups/123456/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day" \
--header "x-api-key: YOUR_API_KEY"
Example Response
200
- No grouping
- Group by day or week
- Group by month
{
"all": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}
{
"2024-01-01": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
},
"2024-02-02": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}
{
"2024-01": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
},
"2024-02": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}
400
- Invalid 'groupID'
- Invalid 'from'
- Invalid 'to'
- Invalid 'groupBy'
{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }
{ "error": "Invalid 'from' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'to' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'groupBy' value. Should be one of ['day', 'week', 'month']." }
401: Unauthorized
Get Wordcloud for a Group
GET /metrics/groups/{groupID}/wordcloud
Get frequency of each word from session transcripts for a group.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
groupID
(required): The group ID of the group you want to view the count of.
Query String Parameters
from
(optional): The start date for the range of sessions to count. Format:YYYY-MM-DD
.to
(optional): The end date for the range of sessions to count. Format:YYYY-MM-DD
.groupBy
(optional): The time period to group the sessions by. Options:day
,week
,month
.top
(optional): The number of top words to return. Must be an integer.
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/metrics/groups/123456/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());
import requests
requests.get("https://api.okaya.me/metrics/groups/123456/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1",
headers={
"x-api-key": "YOUR_API_KEY"
},
).json()
curl --location "https://api.okaya.me/metrics/groups/123456/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1" \
--header "x-api-key: YOUR_API_KEY"
Example Response
200
- No grouping
- Group by day or week
- Group by month
{
"all": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}
{
"2024-01-01": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
},
"2024-02-02": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}
{
"2024-01": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
},
"2024-02": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}
400
- Invalid 'groupID'
- Invalid 'from'
- Invalid 'to'
- Invalid 'groupBy'
- Invalid 'top'
{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }
{ "error": "Invalid 'from' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'to' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'groupBy' value. Should be one of ['day', 'week', 'month']." }
{ "error": "Invalid 'top' value, please specify an integer." }
401: Unauthorized
Get Number of Participant Sessions
GET /metrics/participants/{externalID}/count
Get the number of sessions for a participant.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
externalID
(required): The external identifier for the participant.
Query String Parameters
from
(optional): The start date for the range of sessions to count. Format:YYYY-MM-DD
.to
(optional): The end date for the range of sessions to count. Format:YYYY-MM-DD
.groupBy
(optional): The time period to group the sessions by. Options:day
,week
,month
.
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/metrics/participants/ok_participant1/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());
import requests
requests.get("https://api.okaya.me/metrics/participants/ok_participant1/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
headers={
"x-api-key": "YOUR_API_KEY"
},
).json()
curl --location "https://api.okaya.me/metrics/participants/ok_participant1/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day" \
--header "x-api-key: YOUR_API_KEY"
Example Response
200
- No grouping
- Group by day or week
- Group by month
{
"all": 10
}
{
"2024-01-01": 10,
"2024-02-02": 10
}
{
"2024-01": 10,
"2024-02": 10
}
400
- Invalid 'externalID'
- Invalid 'from'
- Invalid 'to'
- Invalid 'groupBy'
{ "error": "You are missing the path parameter externalID" }
{ "error": "Invalid 'from' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'to' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'groupBy' value. Should be one of ['day', 'week', 'month']." }
401: Unauthorized
Get MHCI Metrics for a Participant
GET /metrics/participants/{externalID}/mhci
Get MHCI metrics for a participant.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
externalID
(required): The external identifier for the participant.
Query String Parameters
from
(optional): The start date for the range of sessions to count. Format:YYYY-MM-DD
.to
(optional): The end date for the range of sessions to count. Format:YYYY-MM-DD
.groupBy
(optional): The time period to group the sessions by. Options:day
,week
,month
.
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/metrics/participants/ok_participant1/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());
import requests
requests.get("https://api.okaya.me/metrics/participants/ok_participant1/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
headers={
"x-api-key": "YOUR_API_KEY"
},
).json()
curl --location "https://api.okaya.me/metrics/participants/ok_participant1/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day" \
--header "x-api-key: YOUR_API_KEY"
Example Response
200
- No grouping
- Group by day or week
- Group by month
{
"all": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}
{
"2024-01-01": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
},
"2024-02-02": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}
{
"2024-01": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
},
"2024-02": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}
400
- Invalid 'externalID'
- Invalid 'from'
- Invalid 'to'
- Invalid 'groupBy'
{ "error": "You are missing the path parameter externalID" }
{ "error": "Invalid 'from' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'to' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'groupBy' value. Should be one of ['day', 'week', 'month']." }
401: Unauthorized
Get Wordcloud for a Participant
GET /metrics/participants/{externalID}/wordcloud
Get frequency of each word from session transcripts for a participant.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
externalID
(required): The external identifier for the participant.
Query String Parameters
from
(optional): The start date for the range of sessions to count. Format:YYYY-MM-DD
.to
(optional): The end date for the range of sessions to count. Format:YYYY-MM-DD
.groupBy
(optional): The time period to group the sessions by. Options:day
,week
,month
.top
(optional): The number of top words to return. Must be an integer.
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/metrics/participants/ok_participant1/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());
import requests
requests.get("https://api.okaya.me/metrics/participants/ok_participant1/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1",
headers={
"x-api-key": "YOUR_API_KEY"
},
).json()
curl --location "https://api.okaya.me/metrics/participants/ok_participant1/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1" \
--header "x-api-key: YOUR_API_KEY"
Example Response
200
- No grouping
- Group by day or week
- Group by month
{
"all": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}
{
"2024-01-01": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
},
"2024-02-02": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}
{
"2024-01": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
},
"2024-02": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}
400
- Invalid 'externalID'
- Invalid 'from'
- Invalid 'to'
- Invalid 'groupBy'
- Invalid 'top'
{ "error": "You are missing the path parameter externalID" }
{ "error": "Invalid 'from' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'to' date. Please make sure to use the format YYYY-MM-DD." }
{ "error": "Invalid 'groupBy' value. Should be one of ['day', 'week', 'month']." }
{ "error": "Invalid 'top' value, please specify an integer." }