Skip to content

Count a view or a read

POST
/api/v1/stats/hit
curl --request POST \
--url https://example.com/api/v1/stats/hit \
--header 'Content-Type: application/json' \
--data '{ "event": "view", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "kind": "home", "locale": "th", "referrer": "example", "width": 1 }'

Answers 204 whether or not the hit was counted. In bundled mode only this site may send; in headless mode any origin may, with Content-Type: application/json.

Media typeapplication/json
object
event
required
string
Allowed values: view read
id
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
kind
required
string
Allowed values: home post page
locale
required
string
Allowed values: th en
referrer
string
<= 2048 characters
width
required
integer
>= 1 <= 20000

Received. The answer is the same whether or not the hit was counted.