Toon Me API

The Toonme API is a powerful tool that transforms ordinary images into fun cartoon-style images with just a few clicks. With its advanced algorithms and cutting-edge technology, the Toonme API can help businesses and individuals add a touch of creativity and playfulness to their digital content effortlessly.

Introducing the Toonme API, a powerful image-processing tool that transforms your photos into cartoon-style illustrations in seconds! With our API, you can easily integrate the Toonme technology into your own software, app, or website and offer your users a fun and unique way to enhance their photos.

Our state-of-the-art algorithm uses advanced machine learning techniques to analyze and identify the key features of your images and then applies a range of cartoon effects to create stunning illustrations that are sure to impress. From simple line drawings to full-color cartoons, the Toonme API offers a wide range of styles and effects to choose from, giving your users the flexibility to create the perfect look for their images.

Our API is incredibly easy to use, with simple and intuitive methods that allow you to quickly integrate our technology into your existing software. Whether you’re building a photo editing app, a social media platform, or a website that allows users to upload and share images, the Toonme API is the perfect tool to add a touch of creativity and fun.

Some of the key features of the Toonme API include:

  • Fast and reliable image processing

  • A wide range of cartoon styles and effects to choose from

  • Simple and intuitive API methods for easy integration

  • Scalable and flexible architecture that can handle large volumes of requests

  • Robust error handling and support for a variety of image formats

  • With the Toonme API, you can give your users a powerful and fun tool to enhance their photos and express their creativity. So why wait? Sign up today and start exploring the possibilities of the Toonme API!

Using the API

Subscribe to API at: https://toonme-api.magicapi.com/

Go to products and sign up for a Product. For testing sign up for the "free" plan (Required No Credit Card). After that, you can get an API key from the left sidebar "API Keys" page.

Toonifying an image

You can directly send an image URL to toonify it. You can pass any style using the "id" parameter. See below for all available styles.

Please replace 'your-api-key' with your API key from Toonify-API Dashboard.

Request:

curl --location 'https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/' \
--header 'x-magicapi-key: your-api-key' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'image_url=https://telegra.ph/file/f4b77c970783ccdd9e4b9.png' \
--data-urlencode 'id=591'

Response:

{
    "image_process_response": {
        "request_id": "44422884-02ea-4951-b33c-deb5936f0d87",
        "status": "OK",
        "description": null,
        "err_code": "0"
    }
}

This will return a "request_id". You need to then use this request_id to get the processed image using the below request.:

Request

curl --location 'https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/result/' \
--header 'x-magicapi-key: your-api-key' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'request_id=e52dcfb5-c6d3-45bf-8b04-9c898ae4ea61'

Response

{
    "image_process_response": {
        "request_id": "e52dcfb5-c6d3-45bf-8b04-9c898ae4ea61",
        "status": "OK",
        "result_url": "https://worker-images.ws.pho.to/i1/17A1278A-93D5-43BE-B48D-D58984979843.jpg",
        "result_url_alt": "https://worker-images.ws.pho.to/i1/17A1278A-93D5-43BE-B48D-D58984979843.jpg",
        "limited_image_url": "https://worker-images.ws.pho.to/i1/D5ECA32B-4AC7-4CEE-B30D-61001370E854.jpg",
        "nowm_image_url": "https://worker-images.ws.pho.to/i1/17A1278A-93D5-43BE-B48D-D58984979843.jpg",
        "duration": "1421.159029ms",
        "total_duration": "1424.340010ms"
    }
}

Example code in PHP

Toonify Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Ff4b77c970783ccdd9e4b9.png&id=491',
  CURLOPT_HTTPHEADER => array(
    'x-magicapi-key: your-api-key',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Get Result Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/result/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'request_id=e52dcfb5-c6d3-45bf-8b04-9c898ae4ea61',
  CURLOPT_HTTPHEADER => array(
    'x-magicapi-key: your-api-key',
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Javascript(Fetch)

Toonify Request:

var myHeaders = new Headers();
myHeaders.append("x-magicapi-key", "your-api-key");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("image_url", "https://telegra.ph/file/f4b77c970783ccdd9e4b9.png");
urlencoded.append("id", "491");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Result Request

var myHeaders = new Headers();
myHeaders.append("x-magicapi-key", "your-api-key");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("request_id", "e52dcfb5-c6d3-45bf-8b04-9c898ae4ea61");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/result/", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Python

Toonify Request

import requests

url = "https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/"

payload = 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Ff4b77c970783ccdd9e4b9.png&id=491'
headers = {
  'x-magicapi-key': 'your-api-key',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Get Results Request

import requests

url = "https://api.magicapi.dev/api/v1/toonme-api/free/toonme/v1/result/"

payload = 'request_id=e52dcfb5-c6d3-45bf-8b04-9c898ae4ea61'
headers = {
  'x-magicapi-key': 'your-api-key',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Available Styles

You can choose any style by passing "id" in the toonify request.

Last updated