The Blahaj API allows you to fetch random images of the beloved and adorable Blahaj shark!
Find us on GitHub
GET /images/random
Fetches the data of a random image in the database.
The API should almost always return the HTTP status code 200 OK
however if there was a problem connecting to the backend database, the API will respond with the HTTP status code 404 Not Found
Image Found HTTP status 200
// Image found {"author":"N/A","description":null,"id":17,"title":"vMEkeP","url":"https://blahaj.transgirl.dev/images/vMEkeP"}
Database error / Image not found HTTP status 404
// No images in database {'message': 'No images available.'}
GET /images/<filename>
Returns the image data of the specified filename.
If the image exists the API will respond with the HTTP status code 200 OK
if the image doesn't exist, the API will respond with the HTTP status code 404 Not Found
Image Found HTTP status 200
// No JSON data will be returned, only the image will be returned
Image not found HTTP status 404
// Image doesn't exist {'message': 'No such image.'}
To use the API, send a GET request to the specific endpoint and handle the response accordingly. You can integrate the API into your applications to display random Blahaj images or retrieve specific images by filename.
For example, to fetch a random Blahaj image, you can use the following python in your application:
data = requests.get("https://blahaj.transgirl.dev/images/random").json() url = data["url"] image = requests.get(url) # Handle image result
The Blahaj API uses publically available images that are scraped from the r/blahaj reddit, however if you wish to have your image removed please Contact Me