Skip to main content

view_traffic

Creates, updates, deletes, gets or lists a view_traffic resource.

Overview

Nameview_traffic
TypeResource
Idgithub.repos.view_traffic

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
countinteger
uniquesinteger
viewsarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_viewsselectowner, repoperGet the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
perstringThe time frame to display results for.

SELECT examples

Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.

SELECT
count,
uniques,
views
FROM github.repos.view_traffic
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per = '{{ per }}'
;