Pageviews - Lightweight
API DocumentationEndpoint
GET
https://dev.usermetric.io/api/pageviews-lightweight/
Parameters
| Parameters | Details | Description |
|---|---|---|
website_id
|
Optional
Integer
|
|
type
|
Optional
String
|
Allowed values: landing_page, pageview |
continent_code
|
Optional
String
|
Allowed values: AF, AN, AS, EU, NA, OC, SA |
country_code
|
Optional
String
|
Allowed values: AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW |
device_type
|
Optional
String
|
Allowed values: desktop, mobile, tablet |
theme
|
Optional
String
|
Allowed values: light, dark |
browser_language
|
Optional
String
|
Example value: en |
browser_timezone
|
Optional
String
|
Example value: UTC |
search
|
Optional
String
|
The search string. |
search_by
|
Optional
String
|
What field are you searching by. Allowed values are: path, referrer_host, referrer_path, utm_source, utm_medium, utm_campaign, city_name, os_name, browser_name. |
datetime_field
|
Optional
String
|
Allowed values: datetime |
datetime_start
|
Optional
String
|
Filter results starting from this datetime. Y-m-d H:i:s format. |
datetime_end
|
Optional
String
|
Filter results up to this datetime. Y-m-d H:i:s format. |
order_by
|
Optional
String
|
What field to order the results by. Allowed values are: event_id, datetime, expiration_date. |
order_type
|
Optional
String
|
The ordering of the results. Allowed values are: ASC for ascending ordering, and DESC for descending ordering. |
page
|
Optional
Integer
|
The page number that you want results from. Defaults to 1. |
results_per_page
|
Optional
Integer
|
How many results you want per page. Allowed values are: 10, 25, 50, 100, 250, 500, 1000. Defaults to 25. |
Example
curl --request GET \
--url 'https://dev.usermetric.io/api/pageviews-lightweight/' \
--header 'Authorization: Bearer {api_key}' \
Response example
{
"data": [
{
"id": 1,
"website_id": 1,
"type": "pageview",
"path": "/dashboard",
"referrer_host": null,
"referrer_path": null,
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"continent_code": "EU",
"country_code": "DE",
"city_name": "Munich",
"os_name": "OS X",
"browser_name": "Chrome",
"browser_language": "en",
"browser_timezone": "UTC",
"screen_resolution": "1920x1080",
"device_type": "desktop",
"theme": "dark",
"expiration_date": "2027-09-22",
"datetime": "2026-09-22 02:54:47",
"last_datetime": null
}
],
"meta": {
"page": 1,
"total_pages": 1,
"results_per_page": 25,
"total_results": 1
},
"links": {
"first": "https://dev.usermetric.io/api/pageviews-lightweight?page=1",
"last": "https://dev.usermetric.io/api/pageviews-lightweight?page=1",
"next": null,
"prev": null,
"self": "https://dev.usermetric.io/api/pageviews-lightweight?page=1"
}
}
Endpoint
GET
https://dev.usermetric.io/api/pageviews-lightweight/{event_id}
Example
curl --request GET \
--url 'https://dev.usermetric.io/api/pageviews-lightweight/{event_id}' \
--header 'Authorization: Bearer {api_key}' \
Response example
{
"data": {
"id": 1,
"website_id": 1,
"type": "pageview",
"path": "/dashboard",
"referrer_host": null,
"referrer_path": null,
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"continent_code": "EU",
"country_code": "DE",
"city_name": "Munich",
"os_name": "OS X",
"browser_name": "Chrome",
"browser_language": "en",
"browser_timezone": "UTC",
"screen_resolution": "1920x1080",
"device_type": "desktop",
"theme": "dark",
"expiration_date": "2027-09-22",
"datetime": "2026-09-22 02:54:47",
"last_datetime": null
}
}
Endpoint
POST
https://dev.usermetric.io/api/pageviews-lightweight
Parameters
| Parameters | Details | Description |
|---|---|---|
website_id
|
Required
Integer
|
|
type
|
Required
String
|
Allowed values: pageview, landing_page |
path
|
Required
String
|
Example value: /dashboard |
referrer_host
|
Optional
String
|
Example value: example.com |
referrer_path
|
Optional
String
|
Example value: /page |
utm_source
|
Optional
String
|
|
utm_medium
|
Optional
String
|
|
utm_campaign
|
Optional
String
|
|
continent_code
|
Optional
String
|
Allowed values: AF, AN, AS, EU, NA, OC, SA |
country_code
|
Optional
String
|
Allowed values: AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW |
city_name
|
Optional
String
|
Example value: New York |
os_name
|
Optional
String
|
Example value: OS X |
device_type
|
Required
String
|
Allowed values: desktop, mobile, tablet |
theme
|
Required
String
|
Allowed values: light, dark |
browser_name
|
Optional
String
|
Example value: Chrome |
browser_language
|
Optional
String
|
Example value: en |
browser_timezone
|
Optional
String
|
Example value: UTC |
screen_resolution
|
Optional
String
|
Example value: 1920x1080 |
Example
curl --request POST \
--url 'https://dev.usermetric.io/api/pageviews-lightweight' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'website_id=1' \
--form 'path=/dashboard' \
--form 'type=pageview' \
--form 'device_type=desktop' \
--form 'theme=light' \
Response example
{
"data": {
"id": 1
}
}
Endpoint
POST
https://dev.usermetric.io/api/pageviews-lightweight/{event_id}
Parameters
| Parameters | Details | Description |
|---|---|---|
website_id
|
Optional
Integer
|
|
type
|
Optional
String
|
Allowed values: pageview, landing_page |
path
|
Optional
String
|
Example value: /dashboard |
referrer_host
|
Optional
String
|
Example value: example.com |
referrer_path
|
Optional
String
|
Example value: /page |
utm_source
|
Optional
String
|
|
utm_medium
|
Optional
String
|
|
utm_campaign
|
Optional
String
|
|
continent_code
|
Optional
String
|
Allowed values: AF, AN, AS, EU, NA, OC, SA |
country_code
|
Optional
String
|
Allowed values: AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW |
city_name
|
Optional
String
|
Example value: New York |
os_name
|
Optional
String
|
Example value: OS X |
device_type
|
Optional
String
|
Allowed values: desktop, mobile, tablet |
theme
|
Optional
String
|
Allowed values: light, dark |
browser_name
|
Optional
String
|
Example value: Chrome |
browser_language
|
Optional
String
|
Example value: en |
browser_timezone
|
Optional
String
|
Example value: UTC |
screen_resolution
|
Optional
String
|
Example value: 1920x1080 |
Example
curl --request POST \
--url 'https://dev.usermetric.io/api/pageviews-lightweight/{event_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'path=/dashboard' \
Response example
{
"data": {
"id": 1
}
}
Endpoint
DELETE
https://dev.usermetric.io/api/pageviews-lightweight/{event_id}
Example
curl --request DELETE \
--url 'https://dev.usermetric.io/api/pageviews-lightweight/{event_id}' \
--header 'Authorization: Bearer {api_key}' \