添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

URL API Reference ( 2022-11-28 )

Download OpenAPI specification : Download

API support : [email protected]

Every uploaded file is immediately available on the Uploadcare CDN. The CDN includes on-the-fly processing features and can work as a proxy.

Your original filenames can be accessed via REST API . Make a request to receive a JSON response with file parameters including original_filename .

You can set an optional filename that users will see instead of the original name:

https://ucarecdn.com/:uuid/:filename

:filename should comply with file name conventions and it should be a valid part of a URL. For example, filename.ext .

Here are some examples with full CDN URLs:

Safe:
// adding a simple filename
https://ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/image.jpg
// using a char allowed in the pchar definition
https://ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/image@2x.jpg
// allowed in pchar together with Image Transformations
https://ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/-/preview/-/resize/550x/image@1x.jpg
// using a sub-delim allowed in pchar together with Image Transformations
https://ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/-/preview/-/grayscale/image_black&white@2x.jpg
// using percent-encoded gen-delims that are not allowed in pchar
https://ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/-/preview/-/grayscale/image%5Bdesaturated%5D@2x.jpg
Unsafe:
// using gen-delims that are not allowed in pchar without encoding
https://ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/-/preview/-/grayscale/image[desaturated]@2x.jpg

Groups are file collections. Use them to organize content in your Uploadcare project. A common use case is to use them in the single content upload or delivery transactions.

For instance, you can create groups when you upload multiple files. For the new uploader this option is turned off by default. For jQuery widget , a new group is automatically created.

When it's turned on, it stores UUIDs of uploaded files. You can access file collections via :group_uuid :

https://ucarecdn.com/cd334b26-c641-4393-bcce-b5041546430d~11/

:group_uuid is similar to a single file UUID, but it has the file number ~N at the end. A group can contain up to 1000 files.

A group URL will show a list of individual file URLs with their UUIDs, and index numbers in that group.

Learn more about creating and managing groups.

Accessing single files in a group

Request a specific file in a group by adding /nth/i/, where i is a file index, starting from 0:

/:group_uuid/nth/0/
/:group_uuid/nth/1/
/:group_uuid/nth/2/

Note, there is no /-/ separator after a group UUID. It's required for transformations only.

By the way, you can apply image transformations to the indivitual files within a group:

/:group_uuid/nth/0/-/resize/256x/

You can also group the processed files with the respective operation sequences. When you request a file by its group URL, it'll include all operations before adding it to that group. Adding more operations after /-/ will apply them over the existing ones.

Get a group as an archive

Getting a group as an archive is done via the archive group processing operation.

The operation limits are:

  • A total size of uncompressed files ≤ 2 GB.
  • Processing operations will be discarded. Only original files will be archived.
  • Here's how to get an archived file group:

    /:group_uuid/archive/:format/:filename
    
  • :group_uuid — UUID of a file group you want to get as an archive.
  • :format — the format of that output archive, we support zip and tar.
  • :filename (optional) — output archive filename.
  • Note: If the group contains a removed file, the archive operation will fail with a 404 error code.

    With Uploadcare, you can easily build custom image transformation workflows and automate most image manipulation and optimization tasks. For example, you can set up a chain of actions for user-generated images that'll unify their look.

    Every URL image operation generates a modified image version on the fly, while the original file stays intact. The transformed image version will be cached on CDN nodes to optimize delivery.

    Input image formats

    List of supported image formats:

    Some formats have several variations, and we support the most popular ones. Contact sales if you require additional formats or variations.

    Without any image processing operation in the URL, CDN instructs browsers to show images ( Content-Disposition: inline ) and download other file types ( Content-Disposition: attachment ). Browsers may not show all image formats, for example, TIFF and HEIC format. If you need to display an image, add any image processing operation, -/preview/ for instance. The inline control allows you to change this behavior.

    -/inline/yes/
    -/inline/no/
    

    Core operations

    When processing images, add at least one of the following operations via their respective URL directives:

  • resize
  • smart_resize
  • scale_crop
  • preview
  • Output image dimensions

    The dimensions you specify for the last operation should not exceed 3000x3000 pixels. You can go up to 5000x5000 pixels by explicitly setting your image format to JPEG, cdn›/format/jpeg/.

    You can extend the output max resolution up to 8192x8192, and up to 16384x16384 for JPEGs in trade-off for increased latency. Contact sales to learn more about this option.

    SVG files

    Any image transformation CDN URL is valid with an SVG file. Most operations don't affect the response SVG body, while geometric operations (crop, preview, resize, scale_crop) change SVG attributes and work as expected.

    To apply full range of operations on SVG file, it should be rasterized by applying -/rasterize/ operation.

    Note: Operation is safe to apply to any image. Not SVG images won't be affected by this operation.

    SVGs uploaded before May 26, 2021 still have is_image: false and adding processing operations to them will result in error. Contact support to batch process previously uploaded files.

    Image resolution

    We don’t provide on-the-fly image processing for images greater than 75 Mpx in resolution: those are tagged as non-image files and can only be delivered via CDN as-is. Adding processing operations to non-image files will result in an error.

    Simple rotation

    When the only image transformation you want is rotating, consider using the preview control without any arguments. When you use any of the transformations, we automatically rotate images according to their EXIF orientation.

    Animated images

    Animated images are treated as static by the transformations engine, consider checking out our GIF to Video workflow optimized for animated images delivery.

    REST API image processing

    Most image processing operations work on-the-fly, except some that must be called via REST API:

  • Background removal
  • Object recognition
  • Video and document thumbnail generation
  • Operation Syntax Format -/format/:format/ Quality -/quality/:value/ Smart compression -/quality/smart/ -/quality/smart_retina/ Progressive JPEG -/progressive/yes/ -/progressive/no/ Meta information control -/strip_meta/all/ -/strip_meta/none/ -/strip_meta/sensitive/ Animated image to video /gif2video/ -/format/:value/ -/quality/:value/ -/preview/ -/preview/:dimensions/ -/resize/:one_or_two_dimensions/ -/crop/:dimensions/ -/crop/:dimensions/:alignment/ -/scale_crop/:dimensions/ -/scale_crop/:dimensions/:alignment/

    Image rotation

    Operation Syntax Preview -/preview/:dimensions/ Resize -/resize/:one_or_two_dimensions/ Smart resize -/smart_resize/:dimensions/ -/crop/:dimensions/ -/crop/:dimensions/:alignment/ Crop by ratio -/crop/:ratio/ -/crop/:ratio/:alignment/ Crop by objects -/crop/:tag/ -/crop/:tag/:ratio/ -/crop/:tag/:ratio/:alignment/ -/crop/:tag/:dimensions/ -/crop/:tag/:dimensions/:alignment/ Scale crop -/scale_crop/:dimensions/ -/scale_crop/:dimensions/:alignment/ Smart crop -/scale_crop/:dimensions/:type/ -/scale_crop/:dimensions/:type/:alignment/ Border radius and circle crop -/border_radius/:radii/ -/border_radius/:radii/:vertical_radii/ Set fill color -/setfill/:color/ Zoom objects -/zoom_objects/:zoom/
    Operation Syntax Automatic rotation, EXIF-based -/autorotate/yes/ -/autorotate/no/ Manual rotation -/rotate/:angle/ -/flip/ Mirror -/mirror/
    Operation Syntax Image overlay -/overlay/:uuid/ -/overlay/:uuid/:rel_dimensions/:rel_coords/:opacity/ Self overlay -/overlay/self/ -/overlay/self/:rel_dimensions/:rel_coords/:opacity/ Text overlay -/text/:rel_dimensions/:rel_coords/:text/ Color overlay -/rect/:color/:relative_dimensions/:relative_coordinates/
    Operation Syntax Basic color adjustment -/brightness/:value/ -/exposure/:value/ -/gamma/:value/ -/contrast/:value/ -/saturation/:value/ -/vibrance/:value/ -/warmth/:value/ Enhance -/enhance/ -/enhance/:strength/ Grayscale -/grayscale/ Inverting -/invert/ Conversion to sRGB -/srgb/fast/ -/srgb/icc/ -/srgb/keep_profile/ ICC profile size threshold -/max_icc_size/0/ -/max_icc_size/:number/ Photo filters -/filter/:name/ -/filter/:name/:amount/
    Operation Syntax -/blur/ -/blur/:strength/ Blur region -/blur_region/:two_dimensions/:two_coords/ -/blur_region/:two_dimensions/:two_coords/:strength/ Blur faces -/blur_region/faces/ -/blur_region/faces/:strength/ Unsharp masking -/blur/:strength/:amount/ Sharpen -/sharp/ -/sharp/:strength/
    Operation Syntax Face detection /detect_faces/ Color recognition -/main_colors/:number_of_colors/
    Operation Syntax Rasterization -/rasterize/ Inline -/inline/