Git Product home page Git Product logo

img-api's Introduction

Image API

This is an API written in Golang for image manipulation commands, primarily targets usage from Discord Bots.

It is used in my bot Miyako and anyone is free to use this.

There used to be an API with the name "Idiotic API" by York. It was great while it lasted but it died now I tried to reinvent some of the endpoints that API had, this time it's open source and self-hosted so it will always be available to you.

Install

Pre-built binaries are available for Windows, macOS and Linux in GitHub Releases, the easiest way to get started is to just download a release which includes everything needed to get started in your machine without installing anything else.

Simply extract the archive and run the img-api binary (img-api.exe on Windows)

On Linux/macOS you can type ./img-api to run it, on Windows you may just double click the exe or type img-api in cmd. (Make sure you are in the correct directory)

If you are on Linux/macOS you may also install via Homebrew just run: brew install ravener/tap/img-api

The API will start in http://localhost:3030 but the port can be changed via -p

If the prebuilt binaries doesn't suit you or you'd like to edit the code then continue for instructions on building, this will require Golang 1.13+ installed.

Setup (No Docker)

Install Golang 1.13+ (git must also be installed) then clone this repository.

$ git clone https://github.com/ravener/img-api
$ cd img-api
# Build the binary
$ go build main.go
# start the server
$ ./main

Setup (Docker)

To run with docker you can use

# Replace target port with the one you want to use on your host (this only exposes it locally)
docker run -d -p <target>:3030 iceemc/img-api:latest
# To expose the server on all interfaces
docker run -d -p 0.0.0.0:<target>:3030 iceemc/img-api:latest

Setup (Pterodactyl)

Just follow the below instructions in order, indicated by the big numbers image

All API endpoints are listed in Endpoints.md

Local Usage or Shared?

There are 2 ways to use this. The first one is the recommended and easiest way: locally.

The server can be accessed only via the same host, only for your bot. This is the default behaviour.

If you want to expose the server to the internet (e.g to share it with a friend.) then you have to run it with -h 0.0.0.0 but anyone who knows your server IP and port will be able to use the API so you might consider adding some sort of authorization. Run it with -s password where password is a secret authorization that you will only share with users you trust and they will have to add an Authorization header with it. Requests from localhost won't be required to authenticate and will work as normal.

Wrappers

I wrote some API wrappers in multiple languages to help users get started quickly.

Unofficial Wrappers:

  • If you made any new wrappers then feel free to add it to this list.

Official wrappers are promised to stay updated with all changes where as unofficial ones depends on the person who made them.

Contributing

Contributions are welcome, whether it is new image template ideas or code contributions. Feel free to open any issues when in doubt.

Also join #img-api in my Discord Server for contacting me and getting updates.

Tip: If you use a web-browser to test the images output in development, pass the -d flag to disable browser cache to make testing easier.

License

Released under the MIT License

I do not own the assets provided.

img-api's People

Contributors

ravener avatar chakany avatar iceemc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.