hit-counter
hit-counter copied to clipboard
Solved: How to Query Raw Counts from Command Line
Here's how you can retrieve the raw count data from the command line using PowerShell:
$response = Invoke-WebRequest -Uri "https://hits.seeyoufarm.com/api/count/keep/badge.svg?url=https://your-website.com"
$content = $response.Content
$counts = ($content | Select-String -Pattern "[0-9]+ / [0-9]+" -All).Matches[0].Value
Write-Host "Counts: $counts"
The history graph data can be queried in a similar fashion using this endpoint:
https://hits.seeyoufarm.com/api/count/graph/dailyhits.svg?url=https://your-website.com
You'll need to do a lot of RegEx parsing to pull the historical data out of the SVG code, but the general principle is the same as my prior example above.