API Duckumentation

QR Code Generator

Need an easier solution? Check out our Online Tool

Welcome to the QR Code Generator API, a simple API designed to generate QR codes for your business or personal needs. This API allows you to create a QR code by passing in text or a URL, and returns a PNG image file of the QR code.

With the QR Code Generator API, you can easily generate QR codes for your website, business cards, marketing materials, or any other purpose. Our API is easy to use and provides fast results, so you can quickly generate a QR code and use it in your designs.

Getting started

To get started with the QR Code Generator API, you need to sign up for an API key. The API key will allow you to authenticate with our API and generate QR codes.

To sign up for an API key, please follow these steps:

  1. Go to the sign up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Once you've signed up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

That's it! With your API key in hand, you're now ready to start using the QR Code Generator API to generate QR codes. In the next section, we'll provide you with more information on how to use it to generate QR codes.

Endpoints

The following endpoint is available in the QR Code Generator API:

GET api/qr-code

This endpoint allows you to generate a QR code by passing in text or a URL. You can pass in the data as a query parameter, and the API will generate a QR code and return a PNG image file.

https://www.duckface.dev/api/qr-code?token=YOUR_API_KEY&type=text&textcontent=Hello%20world!
Input parameters
Parameter Description
token Your unique API Key.
type This parameter specifies the type of data to be encoded in the QR code. Valid values include text, url, email, wifi, tel, sms, and vcard. This parameter is required.
textcontent This parameter is used to specify the text content to be encoded in the QR code. It is used when the type parameter is set to text or url.
emailaddress This parameter is used to specify the email address to be encoded in the QR code. It is used when the type parameter is set to email.
emailsubject This parameter is used to specify the subject of the email to be encoded in the QR code. It is used when the type parameter is set to email.
emailbody This parameter is used to specify the body of the email to be encoded in the QR code. It is used when the type parameter is set to email.
networkname This parameter is used to specify the name of the WiFi network to be encoded in the QR code. It is used when the type parameter is set to wifi.
networkst This parameter is used to specify the security type of the WiFi network to be encoded in the QR code. It is used when the type parameter is set to wifi. Valid values include wep, wpa, wpa2, wpa3
networkpw This parameter is used to specify the password of the WiFi network to be encoded in the QR code. It is used when the type parameter is set to wifi.
telnumber This parameter is used to specify the telephone number to be encoded in the QR code. It is used when the type parameter is set to tel.
smsnumber This parameter is used to specify the telephone number to which an SMS will be sent when the QR code is scanned. It is used when the type parameter is set to sms.
smsmessage This parameter is used to specify the message that will be sent in the SMS when the QR code is scanned. It is used when the type parameter is set to sms.
vname This parameter is used to specify the name of the person or company to be encoded in the QR code. It is used when the type parameter is set to vcard.
vtel This parameter is used to specify the telephone number of the person or company to be encoded in the QR code. It is used when the type parameter is set to vcard.
vemail This parameter is used to specify the email address of the person or company to be encoded in the QR code. It is used when the type parameter is set to vcard.
format This parameter is used to specify the final format of the QR code. It is not required and will be set to webp by default. Valid values include png, jpeg, tiff, bmp and webp.
fill This parameter is used to specify the fill color of the QR code. It is not required and will be set to 000000 by default. Valid values include any valid hexadecimal color codes excluding the "#".
background This parameter is used to specify the background color of the QR code. It is not required and will be set to ffffff by default. Valid values include any valid hexadecimal color codes excluding the "#".
border This parameter is used to specify the border size of the QR code. It is not required and will be set to 4 by default. Valid values include any valid between or matching 0 and 10.
size This parameter is used to specify the size of the QR code. It is not required and will be set to small by default. Valid values include small, medium and large
image_url This parameter is used to specify a URL of an image to be embedded in the center of the QR code. It is not required and can be left empty if no image is to be embedded.
image_file This parameter is used to specify an image file to be embedded in the center of the QR code. It is not required and can be left empty if no image is to be embedded. Only used on POST requests.
responseformat This parameter is used to specify the response format of the QR code. It is not required and will be set to send_file by default. Valid values include send_file and uri.

POST api/qr-code

This endpoint allows you to generate a QR code by sending a POST request with the data of the QR code in the request body. The API will generate a QR code and return a PNG image file.

Response

The API will respond with an image file of the QR code (PNG by default).

Default QR Code Styling Example (Text Data)
Example request
fetch('https://www.duckface.dev/api/qr-code', {
                  method: 'POST',
                  headers: {
                    'Content-Type': 'application/json',
                    'token': 'YOUR_API_KEY',
                  },
                  body: JSON.stringify({
                    type: 'text',
                    textcontent: 'https://www.example.com',
                  })
                })
                .then(response => response.json())
                .then(data => console.log(data))
                .catch(error => console.error(error));

Rate limits

To ensure fair usage of the QR code API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 50 requests per month
  • Paid Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

QR Code is a registered trademark of DENSO WAVE INCORPORATED

Website Page Analysis

Need an easier solution? Check out our Online Tool

Welcome to the Website Page Analysis API, a free API designed to help marketers and website owners improve their website's search engine optimization (SEO) performance. This API allows you to perform comprehensive SEO checks on any webpage and provides you with detailed information on how to optimize your content for better search engine rankings.

With the Website Page Analysis API, you can identify issues that might be affecting your website's ranking, including missing meta tags, broken links, slow loading times, and more. By addressing these issues, you can improve your website's visibility in search results and drive more organic traffic to your site.

Our API is easy to use and provides fast results, so you can quickly identify areas that need improvement and take action to optimize your content. Best of all, our API is completely free to use!

Getting started

To get started with the Website Page Analysis API, all you need to do is sign up for an API key. The API key will allow you to authenticate with our API and access all of its features.

To sign up for an API key, please follow these steps:

  1. Go to the sign up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Once you've signed up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

That's it! With your API key in hand, you're now ready to start using the Website Page Analysis API to perform SEO checks on your webpages. In the next section, we'll provide you with more information on how to use it to perform SEO checks.

Endpoints

The following endpoints are available in the Website Page Analysis API:

GET api/page-analysis

This endpoint allows you to perform an Analysis on a webpage. You can pass in the URL of the webpage as a query parameter, and the API will perform a comprehensive SEO analysis of the page and return a JSON response with the results.

Input parameters
  • token (required): Your unique API Key
  • url (required): The URL of the webpage to check.
https://www.duckface.dev/api/page-analysis?token=YOUR_API_KEY&url=https://www.example.com
Output format

The API will return a JSON response with the following fields:

Field Description
date_analyzed The date when the webpage was analyzed.
screenshot_desktop The desktop screenshot of the webpage.
url_analyzed The URL of the webpage that was analyzed.
cms The content management system used to create the website.
sitemap The sitemap of the webpage, indicating the structure of the website.
robots The robots.txt file of the webpage, indicating how search engines should crawl the website.
indexable Whether the webpage is indexable by search engines.
og_title The Open Graph title of the webpage.
og_title_length The length of the Open Graph title in characters.
og_description The Open Graph description of the webpage.
og_description_length The length of the Open Graph description in characters.
og_url The Open Graph URL of the webpage.
og_image_data_url The Open Graph image URL of the webpage.
og_type The Open Graph type of the webpage, such as "website" or "article".
og_locale The Open Graph locale of the webpage, indicating the language and region.
viewport_content The viewport meta tag of the webpage, indicating how the website should be displayed on mobile devices.
all_links All links on the webpage.
h1 The H1 tag of the webpage, which is typically the main headline.
h1_count The count of H1 tags.
h2 The H2 tag of the webpage, which is typically a subheading.
h2_count The count of H2 tags.
h3 The H3 tag of the webpage, which is typically a sub-subheading.
h3_count The count of H3 tags.
h4 The H4 tag of the webpage, which is typically a sub-sub-subheading.
h4_count The count of H4 tags.
h5 The H5 tag of the webpage.
h5_count The count of H5 tags.
h6 The H6 tag of the webpage.
h6_count The count of H6 tags.
title The title of the webpage.
title_length The length of the webpage title in characters.
description The meta description of the webpage.
description_length The length of the meta description in characters.
text_to_html_ratio The ratio of text to HTML code on the webpage.
word_frequency_1 The most frequently used word on the webpage.
word_frequency_2 The second most frequently used word on the webpage.
word_frequency_3 The third most frequently used word on the webpage.
images The images on the webpage, their source dimensions, and size in bytes.
image_count The number of images on the webpage.
total_image_size_in_bytes The total size of all images on the webpage in bytes.
videos The videos on the webpage, their source, type and size in bytes.
videos_count The number of videos on the webpage.
total_video_size_in_kbytes The total size of all videos on the webpage in bytes.
external_links External links on the webpage.
internal_links Internal links on the webpage.
broken_links_internal The number of broken internal links on the webpage.
broken_internal_links_count The count of broken internal links on the webpage.
broken_links_external The number of broken external links on the webpage.
broken_external_links_count The count of broken external links on the webpage.
internal_links_count The number of internal links on the webpage.
external_links_count The number of external links on the webpage.
mobile_friendly Whether the webpage is mobile-friendly.
canonical_tag The canonical tag of the webpage, indicating the preferred URL for indexing purposes.
pagespeed_insights_performance_score_desktop The performance score of the webpage as measured by Google PageSpeed Insights on desktop.
pagespeed_insights_performance_score_mobile The performance score of the webpage as measured by Google PageSpeed Insights on mobile.
css_libraries The CSS libraries used on the webpage.
response_headers The HTTP headers returned by the server in response to a request for the webpage, providing metadata and control information.

POST api/page-analysis

This endpoint allows you to perform an Analysis on a webpage by sending a POST request with the URL of the webpage in the request body. The API will perform a comprehensive SEO analysis of the page and return a JSON response with the results.

Input parameters

The URL of the webpage should be included in the request body as a JSON object with the following fields:

  • token (required): Your unique API Key
  • url (required): The URL of the webpage to check.
fetch('https://www.duckface.dev/api/page-analysis', {
                        method: 'POST',
                        headers: {
                          'Content-Type': 'application/json',
                          'token': 'YOUR_API_KEY',
                        },
                        body: JSON.stringify({
                          url: 'https://www.example.com',
                        })
                      })
                      .then(response => response.json())
                      .then(data => console.log(data))
                      .catch(error => console.error(error));
                    

Output format

The API will return a JSON response with the same fields as the GET api/page-analysis endpoint.

That's it! These are the two endpoints available in your Website Page Analysis API. You can use these endpoints to perform comprehensive SEO checks on any webpage and get detailed information on how to optimize your content for better search engine rankings.

Rate limits

To ensure fair usage of the Website Page Analysis, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 5 requests per month
  • Paid Plan: 150 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

GA4 Prompt Analysis API

Need an easier solution? Check out our Online Tool

Welcome to the GA4 Prompt Analysis API, a simple API designed to generate GA4 request bodies for your business or personal needs from a simple text prompt. This API allows you to create a request body by passing in a text prompt, and returns a json formatted request body ready with a date range, metrics and dimensions to send to the GA4 API.

Getting started

To get started with the GA4 Prompt Analysis API, you need to sign up for an API key. The API key will allow you to authenticate with our API and generate Request Bodies.

To sign up for an API key, please follow these steps:

  1. Go to the sign up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Once you've signed up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

That's it! With your API key in hand, you're now ready to start using the GA4 Prompt Analysis API. In the next section, we'll provide you with more information on how to use it to generate request bodies.

Endpoints

The following endpoint is available in the GA4 Prompt Analysis API:

GET api/ga4

This endpoint allows you to generate a GA4 request body by passing in a text prompt. You can pass in the data as a query parameter, and the API will return a json formatted request body ready to send to the GA4 API

https://www.duckface.dev/api/ga4?token=YOUR_API_KEY&prompt=mtd%20transactions
Input parameters
Parameter Description
token Your unique API Key.
prompt This parameter specifies the user prompt. This parameter is required.

POST api/ga4

This endpoint allows you to generate a GA4 request body by sending a POST request with the prompt in the request body. The API will return a json formatted request body ready to send to the GA4 API

Response

The API will return a json formatted request body.


                        {
                          "dateRanges": [
                            {
                              "endDate": "YYYY-MM-DD", 
                              "startDate": "YYYY-MM-DD"
                            }
                          ], 
                          "dimensions": [
                            {
                              "name": "dimension_1"
                            }, 
                            {
                              "name": "dimension_2"
                            }
                          ], 
                          "metrics": [
                            {
                              "name": "metric_1"
                            }, 
                            {
                              "name": "metric_2"
                            }
                          ]
                        }
                      
                  
Example request
fetch('https://www.duckface.dev/api/ga4', {
                  method: 'POST',
                  headers: {
                    'Content-Type': 'application/json',
                    'token': 'YOUR_API_KEY',
                  },
                  body: JSON.stringify({
                    prompt: 'How many conversions did we make last week?',
                  })
                })
                .then(response => response.json())
                .then(data => console.log(data))
                .catch(error => console.error(error));
              

Supported GA4 API Metrics
Metric Description
screenPageViews The number of app screens or web pages your users viewed. Repeated views of a single page or screen are counted. (screen_view + page_view events).
keyEvents The count of key events. You can mark any event as a key event in Google Analytics, and some events (i.e. purchase) are marked as key events by default.
sessionKeyEventRate The percentage of sessions in which any key event was triggered.
transactions The count of transaction events with purchase revenue. Transaction events are in_app_purchase, ecommerce_purchase, purchase, app_store_subscription_renew, app_store_subscription_convert, and refund.
totalUsers The number of distinct users who have logged at least one event, regardless of whether the site or app was in use when that event was logged.
totalRevenue The sum of revenue from purchases, subscriptions, and advertising (Purchase revenue plus Subscription revenue plus Ad revenue) minus refunded transaction revenue.
bounceRate The percentage of sessions that were not engaged ((Sessions Minus Engaged sessions) divided by Sessions). This metric is returned as a fraction; for example, 0.2761 means 27.61% of sessions were bounces.
eventCount The count of events.
newUsers The number of users who interacted with your site or launched your app for the first time (event triggered: first_open or first_visit).
sessions The number of sessions that began on your site or app (event triggered: session_start).
averageSessionDuration The average duration (in seconds) of users' sessions.
engagementRate The percentage of engaged sessions (Engaged sessions divided by Sessions). This metric is returned as a fraction; for example, 0.7239 means 72.39% of sessions were engaged sessions.
activeUsers The number of distinct users who visited your site or app.
engagedSessions The number of sessions that lasted longer than 10 seconds, or had a conversion event, or had 2 or more screen views.
eventsPerSession The average number of events per session (Event count divided by Sessions).
sessionConversionRate The percentage of sessions in which any conversion event was triggered.
sessionsPerUser The average number of sessions per user (Sessions divided by Active Users).
userConversionRate The percentage of users who triggered any conversion event.

Supported GA4 API Dimensions
Dimension Description
landingPage The page path associated with the first pageview in a session.
deviceCategory The type of device: Desktop, Tablet, or Mobile.
fullPageUrl The hostname, page path, and query string for web pages visited; for example, the fullPageUrl portion of https://www.example.com/store/contact-us?query_string=true is www.example.com/store/contact-us?query_string=true.
campaignName The name of the marketing campaign. Present only for conversion events. Includes Google Ads Campaigns, Manual Campaigns, & other Campaigns.
medium The medium attributed to the conversion event.
pagePath The portion of the URL between the hostname and query string for web pages visited; for example, the pagePath portion of https://www.example.com/store/contact-us?query_string=true is /store/contact-us.

Rate limits

To ensure fair usage of the GA4 Prompt Analysis API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 50 requests per month
  • Paid Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

PDF to WORD Converter API

Need an easier solution? Check out our Online Tool

Welcome to the PDF to WORD Conversion API, a robust tool designed to convert your PDF documents into editable WORD format. This API allows you to easily transform PDF files into DOCX format, making them ready for editing and formatting.

With the PDF to WORD Conversion API, you can streamline document management and enhance productivity.

Getting Started

To start using the PDF to WORD Conversion API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

Once you have your API key, you're ready to start using the PDF to WORD Conversion API to convert your documents. In the next section, we'll provide more information on how to use the API for document conversion.

Endpoints

The PDF to WORD Conversion API provides the following endpoints:

GET /api/pdf-word

This endpoint allows you to convert a PDF document by providing either a URL or base64 data as query parameters. The API will convert the document and return it in DOCX format. Here's an example:

https://www.duckface.dev/api/pdf-word?token=YOUR_API_KEY&file_url=https://www.example.com/document.pdf

POST /api/pdf-word

This endpoint allows you to convert a PDF document by sending a POST request with the document data in the request body. The API will convert the document and return it in DOCX format. Here's how to use it:

Request with PDF URL

If you want to convert a document hosted at a URL:

fetch('https://www.duckface.dev/api/pdf-word', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'token': 'YOUR_API_KEY',
      },
      body: JSON.stringify({
        file_url: 'https://www.example.com/document.pdf',
      })
    })
    .then(response => response.blob())
    .then(data => {
      // Handle the converted document data
    })
    .catch(error => {
      console.error(error);
    });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/pdf-word', {
  method: 'POST',
  headers: {
    'token': 'YOUR_API_KEY',
  },
  body: formData,
})
.then(response => response.blob())
.then(data => {
  // Handle the converted document data
})
.catch(error => {
  console.error(error);
});
Input Parameters

The PDF to WORD Conversion API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
file_url * The URL of the PDF file you want to convert.
file (Only for POST requests) The PDF file you want to upload for conversion. Ensure that the file size does not exceed the maximum limit (15 MB).
format * docx

Rate limits

To ensure fair usage of the PDF to WORD Conversion API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 5 requests per month
  • Paid Plan: 150 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

PDF to EXCEL Converter API

Need an easier solution? Check out our Online Tool

Welcome to the PDF to EXCEL Conversion API, a robust tool designed to convert your PDF documents into editable EXCEL format. This API allows you to easily transform PDF files into XLSX format, making them ready for editing and formatting.

With the PDF to EXCEL Conversion API, you can streamline document management and enhance productivity.

Getting Started

To start using the PDF to EXCEL Conversion API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

Once you have your API key, you're ready to start using the PDF to EXCEL Conversion API to convert your documents. In the next section, we'll provide more information on how to use the API for document conversion.

Endpoints

The PDF to EXCEL Conversion API provides the following endpoints:

GET /api/pdf-excel

This endpoint allows you to convert a PDF document by providing either a URL or base64 data as query parameters. The API will convert the document and return it in XLSX format. Here's an example:

https://www.duckface.dev/api/pdf-excel?token=YOUR_API_KEY&file_url=https://www.example.com/document.pdf

POST /api/pdf-excel

This endpoint allows you to convert a PDF document by sending a POST request with the document data in the request body. The API will convert the document and return it in XLSX format. Here's how to use it:

Request with PDF URL

If you want to convert a document hosted at a URL:

fetch('https://www.duckface.dev/api/pdf-excel', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'token': 'YOUR_API_KEY',
      },
      body: JSON.stringify({
        file_url: 'https://www.example.com/document.pdf',
      })
    })
    .then(response => response.blob())
    .then(data => {
      // Handle the converted document data
    })
    .catch(error => {
      console.error(error);
    });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/pdf-excel', {
  method: 'POST',
  headers: {
    'token': 'YOUR_API_KEY',
  },
  body: formData,
})
.then(response => response.blob())
.then(data => {
  // Handle the converted document data
})
.catch(error => {
  console.error(error);
});
Input Parameters

The PDF to EXCEL Conversion API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
file_url * The URL of the PDF file you want to convert.
file (Only for POST requests) The PDF file you want to upload for conversion. Ensure that the file size does not exceed the maximum limit (15 MB).

Rate limits

To ensure fair usage of the PDF to EXCEL Conversion API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 5 requests per month
  • Paid Plan: 150 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

PDF Compressor API

Need an easier solution? Check out our Online Tool

Welcome to the PDF Compressor API, a powerful tool engineered to compress your PDF documents effectively, reducing their size while maintaining quality. This API enables you to effortlessly optimize PDF files, making them more manageable and easier to share.

With the PDF Compressor API, you can streamline document storage and transmission processes, enhancing efficiency and reducing storage costs.

Getting Started

To start using the PDF Compressor API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

Once you have your API key, you're ready to start using the PDF Compressor API to convert your documents. In the next section, we'll provide more information on how to use the API for document conversion.

Endpoints

The PDF Compressor API provides the following endpoints:

GET /api/pdf-compress

This endpoint allows you to convert a PDF document by providing either a URL or base64 data as query parameters. The API will compress the document and return it in PDF format. Here's an example:

https://www.duckface.dev/api/pdf-compress?token=YOUR_API_KEY&file_url=https://www.example.com/document.pdf

POST /api/pdf-compress

This endpoint allows you to convert a PDF document by sending a POST request with the document data in the request body. The API will compress the document and return it in PDF format. Here's how to use it:

Request with PDF URL

If you want to convert a document hosted at a URL:

fetch('https://www.duckface.dev/api/pdf-compress', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'token': 'YOUR_API_KEY',
      },
      body: JSON.stringify({
        file_url: 'https://www.example.com/document.pdf',
      })
    })
    .then(response => response.blob())
    .then(data => {
      // Handle the compressed document data
    })
    .catch(error => {
      console.error(error);
    });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/pdf-compress', {
  method: 'POST',
  headers: {
    'token': 'YOUR_API_KEY',
  },
  body: formData,
})
.then(response => response.blob())
.then(data => {
  // Handle the converted document data
})
.catch(error => {
  console.error(error);
});
Input Parameters

The PDF to WORD Conversion API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
file_url * The URL of the PDF file you want to compress.
file (Only for POST requests) The PDF file you want to upload for compression. Ensure that the file size does not exceed the maximum limit (15 MB).

Rate limits

To ensure fair usage of the PDF Compressor API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 5 requests per month
  • Paid Plan: 150 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

PDF Merger API

Need an easier solution? Check out our Online Tool

Welcome to the PDF Merger API, a robust tool designed to merge multiple PDF documents into a single file. This API allows you to easily combine PDF files, streamlining document management and enhancing productivity.

With the PDF Merger API, you can simplify the process of handling multiple PDF documents by merging them into a cohesive single file.

Getting Started

To start using the PDF Merger API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

Once you have your API key, you're ready to start using the PDF Merger API to merge your documents. In the next section, we'll provide more information on how to use the API for document merging.

Endpoints

The PDF Merger API provides the following endpoints:

GET /api/pdf-merge

This endpoint allows you to merge PDF documents by providing either URLs or base64 data as query parameters. The API will merge the documents and return a single PDF file. Here's an example:

https://www.duckface.dev/api/pdf-merger?token=YOUR_API_KEY&file_urls=https://www.example.com/document1.pdf,https://www.example.com/document2.pdf

POST /api/pdf-merger

This endpoint allows you to merge PDF documents by sending a POST request with the document data in the request body. The API will merge the documents and return a single PDF file. Here's how to use it:

Request with PDF URLs

If you want to merge documents hosted at URLs:

fetch('https://www.duckface.dev/api/pdf-merger', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'token': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
      file_urls: ['https://www.example.com/document1.pdf', 'https://www.example.com/document2.pdf'],
    })
  })
  .then(response => response.blob())
  .then(data => {
    // Handle the merged document data
  })
  .catch(error => {
    console.error(error);
  });
Request with File Uploads

If you prefer to upload files directly to the API:

const formData = new FormData();
  formData.append('files', file1); // Replace 'file1' with the actual file object
  formData.append('files', file2); // Replace 'file2' with the actual file object
  
  fetch('https://www.duckface.dev/api/pdf-merger', {
    method: 'POST',
    headers: {
      'token': 'YOUR_API_KEY',
    },
    body: formData,
  })
  .then(response => response.blob())
  .then(data => {
    // Handle the merged document data
  })
  .catch(error => {
    console.error(error);
  });
Input Parameters

The PDF Merger API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
file_urls * A comma-separated list of URLs of the PDF files you want to merge.
files (Only for POST requests) The PDF files you want to upload for merging. Ensure that the combined file size does not exceed the maximum limit (15 MB).

Rate limits

To ensure fair usage of the PDF Merger API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 5 requests per month
  • Paid Plan: 150 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

Image to Text Extraction API

Need an easier solution? Check out our Online Tool

Welcome to the Image to Text Extraction API, an advanced tool designed to extract text from various image formats. This API enables you to convert text from images such as JPG, PNG, and TIFF into editable text formats.

With the Image to Text Extraction API, you can automate the process of digitizing printed documents, making text extraction efficient and reliable.

Getting Started

To start using the Image to Text Extraction API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

Once you have your API key, you're ready to start using the Image to Text Extraction API to extract text from your images. In the next section, we'll provide more information on how to use the API for text extraction.

Endpoints

The Image to Text Extraction API provides the following endpoints:

GET /api/extract

This endpoint allows you to extract text from an image by providing either a URL or base64 data as query parameters. The API will process the image and return the extracted text. Here's an example:

https://www.duckface.dev/api/image-text?token=YOUR_API_KEY&image_url=https://www.example.com/image.jpg

POST /api/image-text

This endpoint allows you to extract text from an image by sending a POST request with the image data in the request body. The API will process the image and return the extracted text. Here's how to use it:

Request with Image URL

If you want to extract text from an image hosted at a URL:

fetch('https://www.duckface.dev/api/image-text', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'token': 'YOUR_API_KEY',
      },
      body: JSON.stringify({
        image_url: 'https://www.example.com/image.jpg',
      })
    })
    .then(response => response.json())
    .then(data => {
      // Handle the extracted text data
    })
    .catch(error => {
      console.error(error);
    });
Request with File Upload

If you prefer to upload an image file directly to the API:

const formData = new FormData();
formData.append('file', yourImage); // Replace 'yourImage' with the actual image file

fetch('https://www.duckface.dev/api/image-text', {
  method: 'POST',
  headers: {
    'token': 'YOUR_API_KEY',
  },
  body: formData,
})
.then(response => response.json())
.then(data => {
  // Handle the extracted text data
})
.catch(error => {
  console.error(error);
});
Input Parameters

The Image to Text Extraction API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file from which you want to extract text.
file (Only for POST requests) The image file you want to upload for text extraction. Ensure that the file size does not exceed the maximum limit (15 MB).
level The desired level of text extraction basic or advanced (AI Powered). Advanced is a Premium feature and costs 2 requests. Defaults to basic.

Rate limits

To ensure fair usage of the Image to Text Extraction API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 5 requests per month
  • Paid Plan: 150 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

Image Resizer API

Need an easier solution? Check out our Online Tool

Welcome to the Image Resizer API, a versatile tool designed to resize your images. This API allows you to efficiently adjust the width and height of your images, providing flexibility for various use cases.

With the Image Resizer API, you can easily tailor the dimensions of your images to meet specific requirements.

Getting Started

To begin using the Image Resizer API, you'll need an API key for authentication. Follow these steps to obtain your API key:

  1. Go to the sign-up page here: Sign-up
  2. Complete the sign-up form with your name, email address, and password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

With your API key, you're ready to start using the Image Resizer API. In the next section, you'll find more information on how to use the API for image resizing.

Endpoints

The Image Resizer API provides the following endpoints:

GET /api/resize

This endpoint allows you to resize an image by providing either a URL or base64 data, along with the required parameters 'width' and 'height'. The API will resize the image and return it. Here's an example:

https://www.example.com/api/resize?token=YOUR_API_KEY&image_url=https://www.example.com/image.png&width=300&height=200

POST /api/resize

This endpoint enables you to resize an image by sending a POST request with the image data in the request body, along with the required parameters 'width' and 'height'. Here's how to use it:

Request with Image URL

If you want to resize an image hosted at a URL:

fetch('https://www.example.com/api/resize', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'token': 'YOUR_API_KEY',
        },
        body: JSON.stringify({
            image_url: 'https://www.example.com/image.png',
            width: 300,
            height: 200
        })
    })
    .then(response => response.blob())
    .then(data => {
        // Handle the resized image data
    })
    .catch(error => {
        console.error(error);
    });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
    formData.append('file', yourFile); // Replace 'yourFile' with the actual file object
    formData.append('width', 300); // Replace '300' with the desired width
    formData.append('height', 200); // Replace '200' with the desired height
    
    fetch('https://www.example.com/api/resize', {
            method: 'POST',
            headers: {
                'token': 'YOUR_API_KEY',
            },
            body: formData,
        })
        .then(response => response.blob())
        .then(data => {
            // Handle the resized image data
        })
        .catch(error => {
            console.error(error);
        });
Input Parameters

The Image Resizer API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file you want to resize.
file (Only for POST requests) The image file you want to upload for resizing. Ensure that the file size does not exceed the maximum limit (15 MB).
width * The desired width for the resized image.
height * The desired height for the resized image.

File Size Limit

The maximum file size limit for image conversion is set at 15 MB. Ensure that the image you provide for conversion does not exceed this limit. If the file size exceeds the limit, the API will return an error.

Rate Limits

To ensure fair usage of the Image Resizer API, rate limits have been implemented based on your subscription plan:

  • Free Plan: 20 requests per month
  • Premium Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you've reached the limit.

If you require a higher rate limit, please contact us here to discuss custom plans and pricing.

Background Remover API

Need an easier solution? Check out our Online Tool

Welcome to the Background Remover API, a cutting-edge solution crafted to remove backgrounds from images effectively. This API empowers you to seamlessly eliminate backgrounds from your images, providing a clean and polished look to your visuals.

With the Background Remover API, you can enhance the visual appeal of your content by isolating subjects, removing distractions, and creating captivating images that leave a lasting impression.

Getting Started

To start using the Background Remover API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

With your API key in hand, you're ready to start using the Background Remover API to remove the background from your images. In the next section, we'll provide you with more information on how to use the API for background removal.

Endpoints

The Background Remover API provides the following endpoints:

GET /api/background-remover

This endpoint enables you to effortlessly remove the background from an image by submitting either a URL or base64 data as query parameters. The API will process the image, effectively removing the background, and return the result without a background in a PNG image format. Here's an example:

https://www.duckface.dev/api/background-remover?token=YOUR_API_KEY&image_url=https://www.example.com/image.png

POST /api/background-remover

This endpoint allows you to remove the background of an image by sending a POST request with the image data in the request body. The API will process the image and return it with the background removed. Here's how to use it:

Request with Image URL

If you want to remove the background of an image hosted at a URL:

fetch('https://www.duckface.dev/api/background-remover', {
      method: 'POST',
      headers: {
          'Content-Type': 'application/json',
          'token': 'YOUR_API_KEY',
      },
      body: JSON.stringify({
        image_url: 'https://www.example.com/image.png',
      })
  })
  .then(response => response.blob())
  .then(data => {
      // Handle the image with the background removed
  })
  .catch(error => {
      console.error(error);
  });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/background-remover', {
  method: 'POST',
  headers: {
    'token': 'YOUR_API_KEY',
  },
  body: formData,
})
.then(response => response.blob())
.then(data => {
  // Handle the image with the background removed
})
.catch(error => {
  console.error(error);
});
Input Parameters

The Background Remover API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file you want to process for background removal.
file (Only for POST requests) The image file you want to upload for background removal. Ensure that the file size does not exceed the maximum limit (15 MB).

Rate limits

To ensure fair usage of the Background Remover API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 20 requests per month
  • Paid Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

Image Compression API

Need an easier solution? Check out our Online Tool

Welcome to the Image Compression API, a powerful tool designed to compress your images in PNG and JPG formats. This API enables you to efficiently reduce the file size of your images while maintaining acceptable quality.

With the Image Compression API, you can optimize your website's performance by reducing image loading times.

Getting Started

To start using the Image Compression API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

With your API key in hand, you're ready to start using the Image Compression API to optimize your images. In the next section, we'll provide you with more information on how to use the API for image compression.

Endpoints

The Image Compression API provides the following endpoints:

GET /api/compress

This endpoint allows you to convert an image by providing either a URL or base64 data as query parameters. The API will convert the image and return it in WEBP format. Here's an example:

https://www.duckface.dev/api/compress?token=YOUR_API_KEY&format=png&image_url=https://www.example.com/image.png

POST /api/compress

This endpoint allows you to compress an image by sending a POST request with the image data in the request body. The API will compress the image and return it in PNG or JPG format, depending on the original format. Here's how to use it:

Request with Image URL

If you want to compress an image hosted at a URL:

fetch('https://www.duckface.dev/api/compress', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'token': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
      image_url: 'https://www.example.com/image.png',
      format: 'png',
    })
  })
  .then(response => response.blob())
  .then(data => {
    // Handle the compressed image data
  })
  .catch(error => {
    console.error(error);
  });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
  formData.append('file', yourFile); // Replace 'yourFile' with the actual file object
  formData.append('format', png / jpg); // Replace 'format' with the actual file format

fetch('https://www.duckface.dev/api/compress', {
        method: 'POST',
        headers: {
            'token': 'YOUR_API_KEY',
        },
        body: formData,
    })
    .then(response => response.blob())
    .then(data => {
        // Handle the compressed image data
    })
    .catch(error => {
        console.error(error);
    });
Input Parameters

The Image Compression API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file you want to compress.
file (Only for POST requests) The image file you want to upload for compression. Ensure that the file size does not exceed the maximum limit (15 MB).
format * png, jpg or webp

Rate limits

To ensure fair usage of the Image Compression API, we have implemented rate limits on the number of requests that can be made within a certain period of time. The rate limits are as follows:

  • Free Plan: 20 requests per month
  • Paid Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you have exceeded the rate limit.

If you require a higher rate limit, please contact us Here to discuss custom plans and pricing.

Image to WEBP Converter

Need an easier solution? Check out our Online Tool

Welcome to the Image to WEBP Converter API, a powerful tool designed to convert your images to the modern WEBP format. This API enables you to quickly convert images to WEBP, a format known for its superior compression and faster loading times.

With the Image to WEBP Converter, you can effortlessly enhance your website's performance by converting images to the efficient WEBP format.

Getting Started

To start using the Image to WEBP Converter API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

With your API key in hand, you're ready to start using the WEBP API to convert your images. In the next section, we'll provide you with more information on how to use the API for image conversion.

Endpoints

The Image to WEBP Converter API provides the following endpoints:

GET /api/webp

This endpoint allows you to convert an image by providing either a URL or base64 data as query parameters. The API will convert the image and return it in WEBP format. Here's an example:

https://www.duckface.dev/api/webp?token=YOUR_API_KEY&image_url=https://www.example.com/image.png

POST /api/webp

This endpoint enables you to convert an image by sending a POST request with the image data in the request body. The API will convert the image and return it in WEBP format. You can either provide the image as a URL or as a file upload. Here's how to use it:

Request with Image URL

If you want to convert an image hosted at a URL:

fetch('https://www.duckface.dev/api/webp', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'token': 'YOUR_API_KEY',
        },
        body: JSON.stringify({
            image_url: 'https://www.example.com/image.png',
            quality: '80',
        })
    })
    .then(response => response.blob())
    .then(data => {
        // Handle the converted WEBP image data
    })
    .catch(error => {
        console.error(error);
    });
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/webp', {
        method: 'POST',
        headers: {
            'token': 'YOUR_API_KEY',
        },
        body: formData,
    })
    .then(response => response.blob())
    .then(data => {
        // Handle the converted WEBP image data
    })
    .catch(error => {
        console.error(error);
    });
Input Parameters

The Image to WEBP Converter API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file you want to convert.
quality The quality of the converted image (1-100). Higher values result in larger file sizes. (Defaults to 80)
file (Only for POST requests) The image file you want to upload for conversion. Ensure that the file size does not exceed the maximum limit (15 MB).

File Size Limit

The maximum file size limit for image conversion is set at 15 MB. Ensure that the image you provide for conversion does not exceed this limit. If the file size exceeds the limit, the API will return an error.

Benefits of Using WEBP Images

WEBP images offer several advantages over traditional formats like JPEG and PNG:

  • Smaller File Sizes: WEBP images are typically smaller, leading to faster page load times and reduced bandwidth usage.
  • Better Compression: Advanced compression algorithms in WEBP often result in smaller file sizes than JPEG and PNG.
  • Improved Image Quality: Despite smaller file sizes, WEBP images can maintain excellent quality, especially for detailed images.
  • Transparency Support: Like PNG, WEBP supports transparency for images with transparent backgrounds.

Overall, WEBP offers several advantages, making it a suitable choice for web and mobile applications where fast loading times and efficient image delivery are critical.

Rate Limits

To ensure fair usage of the Image to WEBP Converter API, rate limits have been implemented based on your subscription plan:

  • Free Plan: 20 requests per month
  • Premium Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you've reached the limit.

If you require a higher rate limit, please contact us here to discuss custom plans and pricing.

Image to PNG Converter

Need an easier solution? Check out our Online Tool

Welcome to the Image to PNG Converter API, a powerful tool designed to convert your images to the PNG format. This API enables you to quickly convert images to PNG, a format known for its lossless compression and support for transparency.

With the Image to PNG Converter, you can effortlessly convert your images to the high-quality PNG format for various applications.

Getting Started

To start using the Image to PNG Converter API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

With your API key in hand, you're ready to start using the PNG API to convert your images. In the next section, we'll provide you with more information on how to use the API for image conversion.

Endpoints

The Image to PNG Converter API provides the following endpoints:

GET /api/png

This endpoint allows you to convert an image by providing either a URL or base64 data as query parameters. The API will convert the image and return it in PNG format. Here's an example:

https://www.duckface.dev/api/png?token=YOUR_API_KEY&image_url=https://www.example.com/image.jpg

POST /api/png

This endpoint enables you to convert an image by sending a POST request with the image data in the request body. The API will convert the image and return it in PNG format. You can either provide the image as a URL or as a file upload. Here's how to use it:

Request with Image URL

If you want to convert an image hosted at a URL:

fetch('https://www.duckface.dev/api/png', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'token': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
        image_url: 'https://www.example.com/image.jpg',
    })
})
.then(response => response.blob())
.then(data => {
    // Handle the converted PNG image data
})
.catch(error => {
    console.error(error);
});
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/png', {
        method: 'POST',
        headers: {
            'token': 'YOUR_API_KEY',
        },
        body: formData,
    })
    .then(response => response.blob())
    .then(data => {
        // Handle the converted PNG image data
    })
    .catch(error => {
        console.error(error);
    });
Input Parameters

The Image to PNG Converter API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file you want to convert.
quality The quality of the converted image (1-100). Higher values result in larger file sizes. (Defaults to 80)
file (Only for POST requests) The image file you want to upload for conversion. Ensure that the file size does not exceed the maximum limit (15 MB).

File Size Limit

The maximum file size limit for image conversion is set at 15 MB. Ensure that the image you provide for conversion does not exceed this limit. If the file size exceeds the limit, the API will return an error.

Benefits of Using PNG Images

PNG images offer several advantages:

  • Lossless Compression: PNG images retain their quality and support transparency, making them ideal for graphics and images with sharp edges.
  • Transparency Support: PNG images support alpha channels for precise transparency control.

Overall, PNG is a suitable choice for images where maintaining quality and transparency is crucial.

Rate Limits

To ensure fair usage of the Image to PNG Converter API, rate limits have been implemented based on your subscription plan:

  • Free Plan: 20 requests per month
  • Premium Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you've reached the limit.

If you require a higher rate limit, please contact us here to discuss custom plans and pricing.

Image to JPG Converter

Need an easier solution? Check out our Online Tool

Welcome to the Image to JPG Converter API, a powerful tool designed to convert your images to the JPG format. This API enables you to quickly convert images to JPG, a format known for its widespread compatibility and reasonable compression.

With the Image to JPG Converter, you can effortlessly convert your images to the widely-used JPG format for various applications.

Getting Started

To start using the Image to JPG Converter API, you'll need to obtain an API key for authentication. Follow these steps to get your API key:

  1. Go to the sign-up page here: Sign-up
  2. Fill out the sign-up form with your name, email address, and a password.
  3. Click on the "Sign Up" button to create your account.
  4. Upon signing up, you'll receive a confirmation email.
  5. Click the link in the email to confirm your account.

With your API key in hand, you're ready to start using the JPG API to convert your images. In the next section, we'll provide you with more information on how to use the API for image conversion.

Endpoints

The Image to JPG Converter API provides the following endpoints:

GET /api/jpg

This endpoint allows you to convert an image by providing either a URL or base64 data as query parameters. The API will convert the image and return it in JPG format. Here's an example:

https://www.duckface.dev/api/jpg?token=YOUR_API_KEY&image_url=https://www.example.com/image.png

POST /api/jpg

This endpoint enables you to convert an image by sending a POST request with the image data in the request body. The API will convert the image and return it in JPG format. You can either provide the image as a URL or as a file upload. Here's how to use it:

Request with Image URL

If you want to convert an image hosted at a URL:

fetch('https://www.duckface.dev/api/jpg', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'token': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
        image: 'https://www.example.com/image.png',
    })
})
.then(response => response.blob())
.then(data => {
    // Handle the converted JPG image data
})
.catch(error => {
    console.error(error);
});
Request with File Upload

If you prefer to upload a file directly to the API:

const formData = new FormData();
formData.append('file', yourFile); // Replace 'yourFile' with the actual file object

fetch('https://www.duckface.dev/api/jpg', {
        method: 'POST',
        headers: {
            'token': 'YOUR_API_KEY',
        },
        body: formData,
    })
    .then(response => response.blob())
    .then(data => {
        // Handle the converted JPG image data
    })
    .catch(error => {
        console.error(error);
    });
Input Parameters

The Image to JPG Converter API accepts the following input parameters:

Parameter Description
token * Your unique API Key.
image_url * The URL of the image file you want to convert.
quality The quality of the converted image (1-100). Higher values result in larger file sizes. (Defaults to 80)
file (Only for POST requests) The image file you want to upload for conversion. Ensure that the file size does not exceed the maximum limit (15 MB).

File Size Limit

The maximum file size limit for image conversion is set at 15 MB. Ensure that the image you provide for conversion does not exceed this limit. If the file size exceeds the limit, the API will return an error.

Benefits of Using JPG Images

JPG images offer widespread compatibility and reasonable compression:

  • Compatibility: JPG images are widely supported across various devices and platforms.
  • Compression: JPG images provide a good balance between image quality and file size, making them suitable for web and print applications.

Overall, JPG is a versatile format for images used in various contexts.

Rate Limits

To ensure fair usage of the Image to JPG Converter API, rate limits have been implemented based on your subscription plan:

  • Free Plan: 20 requests per month
  • Premium Plan: 1500 requests per month

If you exceed the rate limit, the API will return a 429 Too Many Requests status code with a message indicating that you've reached the limit.

If you require a higher rate limit, please contact us here to discuss custom plans and pricing.