How to use Image Anonymization API with JavaScript in 5 minutes?
Tags: imageanonymization, javascript, ai, api
Published: 2023-01-11 14:46:51

*In this tutorial, you will learn how to use Image Anonymization API in 5 minutes using JavaScript. Eden AI provides an easy and developer-friendly API that allows you to anonymize images.*

## **What is Image Anonymization ?**

[Image anonymization](https://www.edenai.co/feature/anonymization?referral=how-to-anonymize-javascript) is a technology that helps to protect privacy by detecting and anonymizing faces or other identifiable objects in photographs. It is used in a variety of contexts, including television news and witness protection, to remove personal information from images.
![Image Anonymization API response - Eden AI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgqfpp4cbc8ryua7e1uq.png)

This technology is compliant with GDPR, APPI, and CCPA regulations, which are designed to protect the privacy of individuals. It is particularly useful for blurring out sensitive information in street scene data, such as faces and license plate numbers.

**[Try Eden AI for FREE](https://app.edenai.run/user/register?referral=how-to-anonymize-javascript)**

## **Getting Started with Image Anonymization API**

The first step is to set Axios, a promise-based HTTP client for the browser and Node.js, that will allow you to call Eden AI API.

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f08881993bd518d9ca0cc_carbon(3).png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f08881993bd518d9ca0cc_carbon(3).png)

Next, you'll need to initialize the File System module in order to access local files on your computer.
![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f088e8cc139623cbbce22_carbon(2).png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f088e8cc139623cbbce22_carbon(2).png)
Finally, you'll need to create your multipart/formdata parameters form:
![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f09b0a3de914651c26a15_formdata.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f09b0a3de914651c26a15_formdata.png)
## **How to use Image Anonymization API with JavaScript**
### **1. Get your Image Anonymization API Key on Eden AI**

To perform Image Anonymization, make sure to create an account on [Eden AI](https://www.edenai.co/feature/anonymization?referral=how-to-anonymize-javascript) for free. Then, you will be able to get your **API key** direclty from the homepage with free credits offered by Eden AI.

![Eden AI platform - Get your API key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7vfhhwuzrf0i1xk5fq5.png)

**[Get your API key for FREE](https://app.edenai.run/user/register?referral=how-to-anonymize-javascript)**

### **2. Start anonymizing your images**

Now that you have imported packages on JavaScript and got your API key, you will be able to anonymize your images. With Eden AI, you can choose from a wide range of different engines you want for Image Anonymization.

Here is our [list of Image Anonmyzation APIs](https://docs.edenai.co/reference/image_anonymization_create?referral=how-to-anonymize-javascript) to help you choose the provider that best suits your project and needs.

Here is the JavaScript code to add the FormData parameters values for your request:

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f1f3ddc880e300cd5f63e_carbon(6).png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f1f3ddc880e300cd5f63e_carbon(6).png)

Once the parameters values are passed, you can configure your request:

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f1f50a0a35367de522cb4_carbon(7).png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f1f50a0a35367de522cb4_carbon(7).png)

That's it! All you have to do is launch the request and print the result:

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f1f33176ade43eda2b921_print-js.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/638f1f33176ade43eda2b921_print-js.png)

## **Benefits of using Image Anonymization API with Eden AI**

Using Image Anonymization with Eden AI API is quick and easy.

![Best Image Anonymization AIs in one API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipt3532iz2ovs9jnano3.gif)

### Save time and cost

We offer a unified API for all providers: simple and standard to use, with a quick switch between providers and an access to the specificic features of each provider

### Easy to integrate

The JSON output format is the same for all suppliers thanks to Eden AI's standardisation work. The response elements are also standardised thanks to Eden AI's powerful matching algorithms.

### Customization

With Eden AI you have the possibility to integrate a third party platform: we can quickly develop connectors. To go further and customize your Image Anonymization request with specific parameters, check out our [documentation](https://docs.edenai.co/reference/image_anonymization_create?referral=how-to-anonymize-javascript).

**[Create your Account on Eden AI](https://app.edenai.run/user/register?referral=how-to-anonymize-javascript)**