An API dedicated to kitty cats.
Kit-API is a project I started when another cat fact API that I used for a while went down for a few days. Hopefully Kit-API can provide cat facts to someone else in their time of need. The API is completely free to use, and open source.
All endpoints should be prefixed with https://kit-api.com/v1
.
/fact
: Gets 1 random fact./fact/{id}
: Gets a fact with a particular id. e.g/fact/2
/system/requests
: Gets the total requests made on the current API version.
To get started just make a request to one of the endpoints!
curl -X GET "https://kit-api.com/v1/fact"
{"id": 11, "fact": "Cats have 18 toes.", "uses": 30}
import aiohttp
import asyncio
async def main() -> None:
URL = "https://kit-api.com/v1/fact/12"
session = aiohttp.ClientSession()
async with session.get(URL) as response:
print(await response.json())
await session.close()
if __name__ == "__main__"
asyncio.run(main())
{"id": 12,"fact": "Cat owners spend around 2 Billion USD per year on cat food.", "uses": 25}
use tokio;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let url = "https://kit-api.com/v1/system/requests";
let response = reqwest::get(url).await?;
println!("{}", response.text().await?);
Ok(())
}
123
Kit-API is licensed under the BSD 3-Clause License.