# Statistics

## GET /api/v1/stats/traffic

> Get user traffic stats

````json
{"openapi":"3.0.3","info":{"title":"Resellers API specification","version":"1.0.0"},"servers":[{"url":"/"}],"security":[{"userBearerAuth":[]}],"components":{"securitySchemes":{"userBearerAuth":{"description":"Bearer authentication with sentinel token for users.\n\nYou can use the following command to get the bearer token:\n\n```\ncurl -d '{\"username\":\"<username>\", \"password\":\"<password>\"}' -H \"Content-Type: application/json\" -X POST -s https://api.goproxies.com/api/v1/login | jq -r '.token'\n```\n\nSubstitute `<username>` and `<password>` with your credentials.\n","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"TrafficStats":{"properties":{"bytes":{"type":"number"},"filter":{"$ref":"#/components/schemas/TrafficStatsQuery"}},"required":["bytes","filter"]},"TrafficStatsQuery":{"properties":{"country":{"type":"string"},"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"username":{"type":"string"}},"required":["start_at","end_at"]},"Error":{"properties":{"error":{"$ref":"#/components/schemas/Err"},"status":{"type":"integer"},"path":{"type":"string"}}},"Err":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"type":"string"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FieldError"}}}},"FieldError":{"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/stats/traffic":{"get":{"summary":"Get user traffic stats","operationId":"getTrafficStats","tags":["Statistics"],"parameters":[{"name":"country","in":"query","description":"Filter by country","required":false,"schema":{"type":"string"}},{"name":"start_at","in":"query","description":"Filter by start date","required":false,"schema":{"type":"string","format":"date-time","default":"end of current day"}},{"name":"end_at","in":"query","description":"Filter by end date","required":false,"schema":{"type":"string","format":"date-time","default":"start of the current month"}},{"name":"username","in":"query","description":"Filter by username of subuser.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficStats"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
````

## GET /api/v1/stats/traffic/history

> Get user traffic stats history

````json
{"openapi":"3.0.3","info":{"title":"Resellers API specification","version":"1.0.0"},"servers":[{"url":"/"}],"security":[{"userBearerAuth":[]}],"components":{"securitySchemes":{"userBearerAuth":{"description":"Bearer authentication with sentinel token for users.\n\nYou can use the following command to get the bearer token:\n\n```\ncurl -d '{\"username\":\"<username>\", \"password\":\"<password>\"}' -H \"Content-Type: application/json\" -X POST -s https://api.goproxies.com/api/v1/login | jq -r '.token'\n```\n\nSubstitute `<username>` and `<password>` with your credentials.\n","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"TrafficHistoryInterval":{"type":"string","enum":["hour","day","week","auto"]},"TrafficHistoryStats":{"properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/TrafficHistoryStat"}},"filter":{"$ref":"#/components/schemas/TrafficHistoryStatsQuery"}},"required":["values","filter"]},"TrafficHistoryStat":{"properties":{"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"bytes":{"type":"number"}},"required":["start_at","end_at","bytes"]},"TrafficHistoryStatsQuery":{"properties":{"country":{"type":"string"},"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"interval":{"$ref":"#/components/schemas/TrafficHistoryInterval"},"username":{"type":"string"}},"required":["start_at","end_at"]},"Error":{"properties":{"error":{"$ref":"#/components/schemas/Err"},"status":{"type":"integer"},"path":{"type":"string"}}},"Err":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"type":"string"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FieldError"}}}},"FieldError":{"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/stats/traffic/history":{"get":{"summary":"Get user traffic stats history","operationId":"getTrafficStatsHistory","tags":["Statistics"],"parameters":[{"name":"country","in":"query","description":"Filter by country","required":false,"schema":{"type":"string"}},{"name":"start_at","in":"query","description":"Filter by start date","required":false,"schema":{"type":"string","format":"date-time","default":"end of current day"}},{"name":"end_at","in":"query","description":"Filter by end date","required":false,"schema":{"type":"string","format":"date-time","default":"start of the current month"}},{"name":"interval","in":"query","description":"Group history into values by given interval","required":false,"schema":{"$ref":"#/components/schemas/TrafficHistoryInterval"}},{"name":"username","in":"query","description":"Filter by username of subuser.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficHistoryStats"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
````

## GET /api/v1/stats/requests/history

> Get user requests history

````json
{"openapi":"3.0.3","info":{"title":"Resellers API specification","version":"1.0.0"},"servers":[{"url":"/"}],"security":[{"userBearerAuth":[]}],"components":{"securitySchemes":{"userBearerAuth":{"description":"Bearer authentication with sentinel token for users.\n\nYou can use the following command to get the bearer token:\n\n```\ncurl -d '{\"username\":\"<username>\", \"password\":\"<password>\"}' -H \"Content-Type: application/json\" -X POST -s https://api.goproxies.com/api/v1/login | jq -r '.token'\n```\n\nSubstitute `<username>` and `<password>` with your credentials.\n","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"TrafficHistoryInterval":{"type":"string","enum":["hour","day","week","auto"]},"RequestsHistoryStats":{"properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/RequestsHistoryStat"}},"filter":{"$ref":"#/components/schemas/RequestsHistoryStatsQuery"}},"required":["values","filter"]},"RequestsHistoryStat":{"properties":{"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"count":{"type":"integer"},"amount":{"type":"integer"}},"required":["start_at","end_at","amount"]},"RequestsHistoryStatsQuery":{"properties":{"country":{"type":"string"},"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"interval":{"$ref":"#/components/schemas/TrafficHistoryInterval"},"username":{"type":"string"},"status":{"type":"integer"},"status_not":{"type":"integer"}},"required":["start_at","end_at","interval"]},"Error":{"properties":{"error":{"$ref":"#/components/schemas/Err"},"status":{"type":"integer"},"path":{"type":"string"}}},"Err":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"type":"string"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FieldError"}}}},"FieldError":{"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/stats/requests/history":{"get":{"summary":"Get user requests history","operationId":"getRequestsHistory","tags":["Statistics"],"parameters":[{"name":"country","in":"query","description":"Filter by country","required":false,"schema":{"type":"string"}},{"name":"start_at","in":"query","description":"Filter by start date","required":false,"schema":{"type":"string","format":"date-time","default":"end of current day"}},{"name":"end_at","in":"query","description":"Filter by end date","required":false,"schema":{"type":"string","format":"date-time","default":"start of the current month"}},{"name":"interval","in":"query","description":"Group history into values by given interval","required":false,"schema":{"$ref":"#/components/schemas/TrafficHistoryInterval"}},{"name":"username","in":"query","description":"Filter by username of subuser.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by request status","required":false,"schema":{"type":"integer"}},{"name":"status_not","in":"query","description":"Filter by request status not equal to","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestsHistoryStats"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
````

## Get countries used in traffic

> Get list of countries used in traffic statistics (in country code in 2-letter 3166-1 alpha-2 format).

````json
{"openapi":"3.0.3","info":{"title":"Resellers API specification","version":"1.0.0"},"servers":[{"url":"/"}],"security":[{"userBearerAuth":[]}],"components":{"securitySchemes":{"userBearerAuth":{"description":"Bearer authentication with sentinel token for users.\n\nYou can use the following command to get the bearer token:\n\n```\ncurl -d '{\"username\":\"<username>\", \"password\":\"<password>\"}' -H \"Content-Type: application/json\" -X POST -s https://api.goproxies.com/api/v1/login | jq -r '.token'\n```\n\nSubstitute `<username>` and `<password>` with your credentials.\n","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UsedCountriesStats":{"properties":{"countries":{"type":"array","items":{"type":"string"}}},"required":["countries"]},"Error":{"properties":{"error":{"$ref":"#/components/schemas/Err"},"status":{"type":"integer"},"path":{"type":"string"}}},"Err":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"type":"string"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FieldError"}}}},"FieldError":{"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/stats/countries":{"get":{"summary":"Get countries used in traffic","description":"Get list of countries used in traffic statistics (in country code in 2-letter 3166-1 alpha-2 format).","operationId":"getUsedCountriesStats","tags":["Statistics"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsedCountriesStats"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.goproxies.com/proxies/resellers-api/statistics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
