Endpoint: /now
Returns the current time, in a variety of formats.
$ curl https://carbon-api.tk/now
{ "request_time": 1507635156.020285, "now": { "epoch": 1507635156.022229, "slang_date": "today", "slang_time": "now", "iso8601": "2017-10-10T11:32:36+00:00", "rfc2822": "Tue, 10 Oct 2017 11:32:36 +0000", "rfc3339": "2017-10-10T11:32:36+00:00" } }
Endpoint: /ip
Returns the IP address of the client.
$ curl https://carbon-api.tk/ip
{ "origin": "127.0.0.1" }
Endpoint: /user_agent
Returns the user-agent of the client.
$ curl https://carbon-api.tk/user_agent
{ "user-agent": "Mozilla/5.0 Firefox/52.0" }
Endpoint: /headers
Returns all HTTP request headers from the current request.
$ curl https://carbon-api.tk/headers
{ "headers": { "Host": "carbon-api.tk", "User-Agent": "Mozilla/5.0 Firefox/31.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Cookie": "_ga=GA1.1.1082408841.1496132797", "DNT": "1", "Connection": "keep-alive", "Upgrade-Insecure-Requests": "1", "Cache-Control": "max-age=0" } }
Endpoint: /download
Generates n megabytes of data where ?size=n. The data file consists of alternating 1's and 0's.
$ curl https://carbon-api.tk/download/100M
HTTP/1.1 200 OK Host: carbon-api.tk Date: Tue, 10 Oct 2017 19:46:17 +0000 Connection: close server: CarbonAPI X-Powered-By: CarbonAPI Content-Type: application/octet-stream Content-Transfer-Encoding: Binary Content-length: 104857600 Content-Disposition: attachment; filename=zero.bin
Endpoint: /tor
Returns whether or not the client is connecting through a TOR node.
$ curl https://carbon-api.tk/tor
{ "origin": "123.123.123.123", "hostname": "exitnode.torproject.org", "tor_node": "true" }
Endpoint: /location
Returns the geographical information of the given host. If no host is specified, Carbon uses the client IP for the lookup.
Accepts fully-qualified domain names and IP (v4/v6) addresses as the host.
$ curl https://carbon-api.tk/location/1.1.1.1
{ "location": { "ip": "1.1.1.1", "hostname": "1dot1dot1dot1.cloudflare-dns.com", "city": "Brisbane", "state_province": "Queensland", "country": "Australia", "ISO3166-1-alpha-2": "AU", "postal_code": 4000, "longitude": -27.4679, "latitude": 153.028, "google_maps": "https://www.google.com/maps/@-27.4679,153.028" } }
Endpoint: /dnt
Returns the status of the HTTP DNT header.
$ curl https://carbon-api.tk/dnt
{ "DNT": "true" }
Endpoint: /referer
Returns the contents of the HTTP Referer header.
Note: Both /referer and /referrer respond to this call. (See Wikipedia.)$ curl https://carbon-api.tk/referer
{ "referer": "https://duckduckgo.com/?q=carbonapi" }
Endpoint: /delay
Delay the connection response for n seconds.
$ curl https://carbon-api.tk/delay/
{ "HTTP Response Code": "HTTP/1.1 200 OK", "response_delay": "5s" }
Endpoint: /uuid
Generate valid RFC 4122 v4 compliant Universally Unique IDentifiers (UUID).
$ curl https://carbon-api.tk/uuid
{ "uuid": "244650e9-715a-4946-be98-43872ae6b067" }
Endpoint: /opengraph
Return OpenGraph tags from url
$ curl https://carbon-api.tk/opengraph/https%3A%2F%2Fcarbon-api.tk/
{ "og": { "locale": "en_US", "type": "article", "title": "Carbon", "description": "Free HTTP Request & Response Service.", "url": "https://www.carbon-api.tk", "site_name": "Carbon", "image": "https://www.carbon-api.tk/images/social.png", "image:width": 512, "image:height": 1024, "updated_time": "2017-10-05T18:10:04+00:00" } }
Endpoint: /go
Redirect client to url
$ curl https://carbon-api.tk/go/www.google.com
HTTP/1.1 302 Found Host: carbon-api.tk Location: https://www.google.com
Endpoint: /status
Return HTTP Status Code matching n. Also returns Warning header with confirmation that the status has actually been returned by Carbon API and not a legitimate server issue.
$ curl https://carbon-api.tk/status/200
{ "Status": "HTTP/1.1 200 OK" }
Endpoint: /password
Returns a randomly generated password n characters long (Defaults to 16).
The password shown in the demo below is blacklisted as a possible return value.
$ curl https://carbon-api.tk/password/16
{ "password": "Vy#[email protected]!Jry", }
Endpoint: /post
Post form data to this endpoint and it'll be returned as JSON.
$ curl https://carbon-api.tk/post -d name='John Doe' -d job='intern' -d department='devops'
{ "input": { "name": "John Doe", "job": "intern", "department": "devops" } }
Endpoint: /feedback
Submit feedback on Carbon API.
$ curl https://carbon-api.tk/feedback -d name='John Doe' -d email='[email protected]' -d message='Hi Carbon!'
{ "feedback": { "name": "John Doe", "email": "[email protected]", "message": "I love Carbon API!" }, "status": "submitted" }