Once you sign up, you can obtain your API key, by going to the dashboard section

API key

You can call the API with any http client of your choice using the API key. Here are examples of usage for different programming languages / tools :

Command line (using cUrl)


curl -v -o crop_example.jpeg -H "X-Imager-Key: YOUR_API_KEY" --data-binary @jpeg_image.jpg 'https://api.imager200.io/crop/sync?x0=100&y0=150&x1=350&y1=400'

Java

     // using Apache httpcomponents-client
      CloseableHttpClient httpclient = HttpClients.createDefault();

      HttpPost httppost = new HttpPost("https://api.imager200.io/crop/sync?x0=100&y0=150&x1=350&y1=400");
      httppost.setHeader("X-Imager-Key", "YOUR_API_KEY");

      httppost.setEntity(new FileEntity(new File("jpeg_image.jpg"), ContentType.APPLICATION_FORM_URLENCODED));

      CloseableHttpResponse response = httpclient.execute(httppost);

      FileUtils.copyInputStreamToFile(response.getEntity().getContent(), new File("crop_example.jpeg"));

JavaScript (Node.js)

var request = require('request');
var fs = require('fs');

request.post({
  url: 'https://api.imager200.io/crop/sync?x0=100&y0=150&x1=350&y1=400',
  body: fs.createReadStream('jpeg_image.jpg'),
  headers: {'X-Imager-Key': 'YOUR_API_KEY'},
  encoding: null
}, function(error, response, body) {
  if (error || response.statusCode != 200 ) { 
       return;
    }
  fs.writeFileSync("crop_example.jpeg", body);
});

Golang

package main

import (
  "net/http"
	"os"
  "fmt"
)


func main() {
	imgfile, err := os.Open("jpeg_image.jpg")

	if err != nil {
		//handle error properly :)
		return
	}

	request, err := http.NewRequest(http.MethodPost, "https://api.imager200.io/grayscale", imgfile)

	if err != nil {
		//handle error properly :)
		return
	}

	request.Header.Add("X-Imager-Key", "YOUR_API_KEY")
	request.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, err := http.DefaultClient.Do(request)

	if err != nil {
		//handle error properly :)
		return
	}

	if res.StatusCode == 201 {
		imageURL := res.Header.Get("Location")
		fmt.Println("image can be downloaded at ", imageURL)
	}
}

More details can be found in the API docs