Live total
300569378
API posts from browsers, scripts, and apps update the count, stats, and recent activity as they arrive.
API examples
1–1000Copy an example and run it in your own app, terminal, or browser console. Any language that can send HTTP requests is supported. These controls only copy code.
curl -X POST https://count.ctrnode.dev/api/post
curl -X POST https://count.ctrnode.dev/api/post -d "amount=50"
curl -X POST https://count.ctrnode.dev/api/post -H "Content-Type: application/json" -d '{"amount":10}'
curl https://count.ctrnode.dev/api/status
Invoke-RestMethod -Method POST https://count.ctrnode.dev/api/post
Invoke-RestMethod -Method POST https://count.ctrnode.dev/api/post -Body "amount=50"
Invoke-RestMethod -Method POST https://count.ctrnode.dev/api/post -ContentType "application/json" -Body '{"amount":10}'
Invoke-RestMethod https://count.ctrnode.dev/api/status | ConvertTo-Json
(Invoke-WebRequest -Method POST https://count.ctrnode.dev/api/post -Body "amount=5").Content
curl -X POST https://count.ctrnode.dev/api/post
curl -X POST https://count.ctrnode.dev/api/post -d "amount=50"
curl -X POST https://count.ctrnode.dev/api/post -H "Content-Type: application/json" -d "{\"amount\":10}"
curl https://count.ctrnode.dev/api/status
wget -qO- --method=POST https://count.ctrnode.dev/api/post
wget -qO- --method=POST --body-data="amount=50" https://count.ctrnode.dev/api/post
wget -qO- https://count.ctrnode.dev/api/status
http POST https://count.ctrnode.dev/api/post
http --form POST https://count.ctrnode.dev/api/post amount=50
http POST https://count.ctrnode.dev/api/post amount:=10
http GET https://count.ctrnode.dev/api/status
python -c "import urllib.request as r; print(r.urlopen(r.Request('https://count.ctrnode.dev/api/post', method='POST')).read().decode())"
python -c "import urllib.request as r,urllib.parse as p; print(r.urlopen(r.Request('https://count.ctrnode.dev/api/post', data=p.urlencode({'amount':50}).encode())).read().decode())"
python -c "import urllib.request as r,json; req=r.Request('https://count.ctrnode.dev/api/post',data=json.dumps({'amount':10}).encode(),headers={'Content-Type':'application/json'}); print(r.urlopen(req).read().decode())"
python -c "import requests; r=requests.post('https://count.ctrnode.dev/api/post', data={'amount':50}); print(r.text)"
python -c "import requests; r=requests.post('https://count.ctrnode.dev/api/post', json={'amount':10}); print(r.text)"
python -c "import urllib.request,json; print(json.dumps(json.load(urllib.request.urlopen('https://count.ctrnode.dev/api/status')),indent=2))"
node -e "fetch('https://count.ctrnode.dev/api/post',{method:'POST'}).then(r=>r.text()).then(console.log)"
node -e "fetch('https://count.ctrnode.dev/api/post',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({amount:50})}).then(r=>r.text()).then(console.log)"
node -e "fetch('https://count.ctrnode.dev/api/post',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'amount=50'}).then(r=>r.text()).then(console.log)"
node -e "fetch('https://count.ctrnode.dev/api/status').then(r=>r.json()).then(d=>console.log(JSON.stringify(d,null,2)))"
curl -X POST https://count.ctrnode.dev/api/post # Go-http-client is auto-detected; use go run for full snippet
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Post("https://count.ctrnode.dev/api/post", "", nil)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
resp, _ := http.Post("https://count.ctrnode.dev/api/post", "application/x-www-form-urlencoded", strings.NewReader("amount=50"))
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://count.ctrnode.dev/api/status")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
ruby -rnet/http -e "puts Net::HTTP.post(URI('https://count.ctrnode.dev/api/post'),nil).body"
ruby -rnet/http -e "puts Net::HTTP.post_form(URI('https://count.ctrnode.dev/api/post'),{amount:50}).body"
ruby -rnet/http -rjson -e "uri=URI('https://count.ctrnode.dev/api/post');h=Net::HTTP.new(uri.host,uri.port);h.use_ssl=uri.scheme=='https';req=Net::HTTP::Post.new(uri);req['Content-Type']='application/json';req.body=JSON({amount:10});puts h.request(req).body"
ruby -rnet/http -rjson -e "puts JSON.pretty_generate(JSON.parse(Net::HTTP.get(URI('https://count.ctrnode.dev/api/status'))))"
php -r "$c=curl_init('https://count.ctrnode.dev/api/post');curl_setopt($c,CURLOPT_POST,1);curl_setopt($c,CURLOPT_RETURNTRANSFER,1);echo curl_exec($c);"
php -r "$c=curl_init('https://count.ctrnode.dev/api/post');curl_setopt_array($c,[CURLOPT_POST=>1,CURLOPT_POSTFIELDS=>'amount=50',CURLOPT_RETURNTRANSFER=>1]);echo curl_exec($c);"
php -r "$c=curl_init('https://count.ctrnode.dev/api/post');curl_setopt_array($c,[CURLOPT_POST=>1,CURLOPT_HTTPHEADER=>['Content-Type: application/json'],CURLOPT_POSTFIELDS=>json_encode(['amount'=>10]),CURLOPT_RETURNTRANSFER=>1]);echo curl_exec($c);"
php -r "echo json_encode(json_decode(file_get_contents('https://count.ctrnode.dev/api/status')),JSON_PRETTY_PRINT);"
Run in your own page or browser developer console. The same fetch API works in JavaScript and TypeScript. Use credentials: "omit" for cross-origin calls; no User-Agent override is needed.
fetch("https://count.ctrnode.dev/api/post", {
method: "POST",
credentials: "omit"
}).then(async response => {
const message = await response.text();
if (!response.ok) throw new Error(message);
console.log(message);
}).catch(console.error);
fetch("https://count.ctrnode.dev/api/post", {
method: "POST",
credentials: "omit",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ amount: 10 })
}).then(async response => {
const message = await response.text();
if (!response.ok) throw new Error(message);
console.log(message);
}).catch(console.error);
fetch("https://count.ctrnode.dev/api/post", {
method: "POST",
credentials: "omit",
body: new URLSearchParams({ amount: "10" })
}).then(async response => {
const message = await response.text();
if (!response.ok) throw new Error(message);
console.log(message);
}).catch(console.error);
Java 11+ standard library. Save as Counter.java, then run: java Counter.java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Counter {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder(URI.create("https://count.ctrnode.dev/api/post"))
.header("Content-Type", "application/x-www-form-urlencoded")
.POST(HttpRequest.BodyPublishers.ofString("amount=10"))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() != 200) {
throw new IllegalStateException(response.body());
}
System.out.println(response.body());
}
}
.NET 6+ console app. Put this in Program.cs and run: dotnet run
using System;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var body = new StringContent("10", Encoding.UTF8, "text/plain");
using var response = await client.PostAsync("https://count.ctrnode.dev/api/post", body);
var message = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(message);
Cargo app. Add under [dependencies] in Cargo.toml: reqwest = { version = "0.13", features = ["blocking", "form"] }. Put the code in src/main.rs and run: cargo run
fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = reqwest::blocking::Client::new()
.post("https://count.ctrnode.dev/api/post")
.form(&[("amount", "10")])
.send()?
.error_for_status()?;
println!("{}", response.text()?);
Ok(())
}
Add the HTTP package: dart pub add http. Save in your Dart app and run it with dart run. This request also works with package:http in Flutter.
import 'package:http/http.dart' as http;
Future<void> main() async {
final response = await http.post(
Uri.parse('https://count.ctrnode.dev/api/post'),
body: {'amount': '10'},
);
if (response.statusCode != 200) {
throw Exception(response.body);
}
print(response.body);
}
Swift 5.5+ on macOS 12+ (or an async context in an iOS 15+ app). Save as Counter.swift and compile: swiftc -parse-as-library Counter.swift -o counter
import Foundation
@main
struct Counter {
static func main() async throws {
let url = URL(string: "https://count.ctrnode.dev/api/post")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONSerialization.data(withJSONObject: ["amount": 10])
let (data, response) = try await URLSession.shared.data(for: request)
guard let http = response as? HTTPURLResponse, http.statusCode == 200 else {
throw URLError(.badServerResponse)
}
print(String(decoding: data, as: UTF8.self))
}
}
Recent activity
API rules
- Browsers and HTTP clients in any language can read the counter and POST to /api/post. Cross-origin requests are supported without cookies or credentials.
- Each post can add a whole number from 1 to 1000.
- Form data, query strings, JSON, and plain text bodies are accepted.
- Live status is available from
/api/status.