strange-bot / strange-image-api

Image Manipulation/Generation API

Home Page:https://strangeapi.hostz.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

Strange API was built to provide Discord bot developers an easy way to get content from the internet. It provides an easy to use interface and takes hard tasks away from developers.

Quick Links:

Authentication

Note

If you don't have the token required to access this API, you can get one for free at the dashboard or by joining our Discord server and using the /apikey generate command.

When calling our API, you must provide a HTTP-Header with name Authorization and value Bearer TOKEN where you replace 'TOKEN' with your token.

Remember that you can also pass the authorization directly by adding a query to the endpoint url like ?apiKey=TOKEN where you replace TOKEN with your token.

Example requesting to image api using superagent

const request = require("superagent");

request
    .get("https://strangeapi.hostz.me/api/generators/beautiful") // the endpoint
    .set("Authorization", "Bearer YourTokenHere") // authentication
    .query({ image: "" }) // the image to be used in the meme (Also work with query parameter above).
    .then((res) => res.body); // handle the buffer response

[!NOTE] > Note: The most of API request response is a Buffer (for image), handle the buffer somehow with your programming language.

Client Libraries

Language Library Author
Typescript strange.js Ghellab Abderrahmane
Typescript strange-api-wrapper Zastinian

Self-hosting

  1. Clone the repository
  2. Install dependencies
  3. Copy .env.example to .env and fill in your environment variables
  4. Build the project with npm run build or yarn build
  5. Start the server with npm start or yarn start
git clone https://github.com/saiteja-madha/strange-image-api.git
cd strange-image-api
npm install # or yarn
cp .env.example .env
npm run build
npm start

Contributing

Contributions are welcome. Please open a pull request with your changes.

Credits

Special thanks to SharifPoetra for sharing his ideas and major ideas were taken from his project.

About

Image Manipulation/Generation API

https://strangeapi.hostz.me


Languages

Language:TypeScript 89.0%Language:EJS 8.2%Language:JavaScript 1.9%Language:CSS 0.5%Language:Dockerfile 0.3%