apyhub
Back
▣ IMAGE PROCESSING · SECURITY & PRIVACY

Pixelize Face API

Hosted on ApyHub

What it does

The Face Pixelation API finds the faces in a photo and returns a copy with each face pixelated. Send a JPEG, PNG, or GIF as a file upload (up to 100 MB) or as a public image_url, and get back a presigned url to the processed image. The link stays valid for one hour, so download or store the image if you need it longer.

When the image has no faces, the response returns a message such as No faces detected in the provided image. instead of a url. Check which field is present and your code knows whether anything was redacted. Detection and pixelation run in one call, with no settings to tune.

Use the face pixelation API to pixelate faces in user-submitted photos before they go public, redact bystanders in street, event, or real estate images, anonymize faces in support screenshots and datasets, or apply a privacy step during content moderation. It works as a face anonymization step for any pipeline that publishes images of people.

To check images for explicit content in the same flow, add the Explicit Image Detection API. If you need face positions without changing the image, use the Face Detection API. To blur faces or cover them with black boxes instead, the Face Blur API offers those modes.

▣ ENDPOINT 01 / 04
POST
Upload image file → S3 presigned URL
https://api.eu.apyhub.com/apyhub/pixelize/file/url

QUICKSTART

GUIDE

Quickstart

Upload an image file to pixelize it.

curl -X POST "https://api.eu.apyhub.com/apyhub/pixelize/file/url" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg"

What you'll get back

Returns a JSON object with either a url string field containing the pixelized image URL, or a message string field with a status/error message.

{
  "url": "https://apyhub-outgoing.s3.amazonaws.com/pixelize/c60cd4f195514f4897eab87839ac48e4_pixelized_20260720_210917%20%281%29.jpg?AWSAccessKeyId=AKIARJOHWS6LWTUUGYPI&Signature=CkLp1vNYME0lrUMSMWVllE06E9w%3D&Expires=1786375119"
}
TRY ITLIVE · 50 ATOMS
Loading playground…

About this endpoint

What it does

Uploads an image file for processing and returns either a presigned S3 URL for the pixelized image or a message explaining why no output URL was produced.

Request Body

ParameterTypeDescription
fileBinaryImage file to process. Supported formats: JPEG, PNG, GIF. Binary file upload.

Response

Returns one of two JSON object shapes on success: either an object with a url string field containing a URI, or an object with a message string field. The schema does not define a single shared wrapper or a success status code.

ParameterTypeDescription
urlStringPresigned S3 URL for the processed image. Format: URI.
messageStringMessage returned when no faces are detected in the provided image.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 04
POST
Image URL → pixelized image download
https://api.eu.apyhub.com/apyhub/pixelize/url/download

QUICKSTART

GUIDE

Quickstart

Download an image from a public URL and process it with Pixelize.

curl -X POST "https://api.eu.apyhub.com/apyhub/pixelize/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://assets.apyhub.com/samples/sample.jpg"}'

What you'll get back

Returns a JSON object with an optional message string field describing the result.

{
  "message": "No faces detected in the provided image."
}
TRY ITLIVE · 50 ATOMS
Loading playground…

About this endpoint

What it does

Downloads a pixelized version of an image from a publicly accessible URL. You send the source image URL in the request body, and the response returns a JSON object with a message string.

Request Body

ParameterTypeDescription
image_urlStringPublicly accessible image URL. Must be a URI. Supported formats: JPEG, PNG, GIF.

Response

Returns a JSON object with a message string field.

ParameterTypeDescription
messageStringResponse message returned by the endpoint.
▣ ENDPOINT 03 / 04
POST
Image URL → S3 presigned URL
https://api.eu.apyhub.com/apyhub/pixelize/url

QUICKSTART

GUIDE

Quickstart

Send a public image URL to pixelize it.

curl -X POST "https://api.eu.apyhub.com/apyhub/pixelize/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://assets.apyhub.com/samples/sample.jpg"}'

What you'll get back

Returns a JSON object with either a url string for the pixelized image, or a message string if the image could not be processed.

{
  "url": "https://s3.amazonaws.com/bucket/pixelized_photo.jpg"
}

Or:

{
  "message": "No faces detected in the provided image."
}
TRY ITLIVE · 50 ATOMS
Loading playground…

About this endpoint

What it does

Takes a publicly accessible image URL and processes the image for pixelization. On success, it returns either a presigned S3 URL to the generated image or a message explaining that no faces were detected.

Request Body

ParameterTypeDescription
image_urlStringPublicly accessible image URL. Supported formats: JPEG, PNG, GIF. Must be a URI.

Response

Returns a JSON object. The success response schema allows one of two top-level shapes: an object with a url string field containing a URI, or an object with a message string field.

ParameterTypeDescription
urlStringPresigned S3 URL to the generated pixelized image. Must be a URI.
messageStringInformational message returned when no faces are detected in the provided image.
▣ ENDPOINT 04 / 04
POST
Upload image file → pixelized image download
https://api.eu.apyhub.com/apyhub/pixelize/file

QUICKSTART

GUIDE

Quickstart

Upload an image file to pixelize it.

curl -X POST "https://api.eu.apyhub.com/apyhub/pixelize/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.png"

What you'll get back

Returns a JSON object with a message string field describing the result.

{
  "message": "No faces detected in the provided image."
}
TRY ITLIVE · 50 ATOMS
Loading playground…

About this endpoint

What it does

Uploads an image file for pixelization processing. The success response is a JSON object with a message string field.

Request Body

ParameterTypeDescription
fileBinaryImage file to process. Supported formats: JPEG, PNG, GIF.

Response

Returns a JSON object with a message string field.

ParameterTypeDescription
messageStringA response message returned by the service. The schema defines this as a string.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.