Uploadcare File information API

There are a few ways to get information about uploaded file. One of them is on-the-fly with a request to CDN. Note: Other APIs also let you read file info: [after Upload](/docs/api/upload/upload/file-upload-info) and [at REST](/docs/api/rest/file/info).

OpenAPI Specification

uploadcare-file-information-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: URL API Reference Add-Ons File information API
  version: '2022-11-28'
  description: 'Every uploaded file is immediately available on the Uploadcare CDN.

    The CDN includes on-the-fly processing features and can work as a proxy.


    ## API endpoints

    Access files in Uploadcare CDN at `ucarecdn.com` over HTTP/HTTPS like this:

    ```https://ucarecdn.com/:uuid/```


    You can add CDN operations by including directives in the CDN URL:

    ```https://ucarecdn.com/:uuid/-/:operation/:params/:filename```


    * `:uuid` stands for the unique file identifier, UUID, assigned on upload.

    * `/-/` is a mandatory parsing delimiter to divide operations and other path components.

    * `:operation/:params/` is a CDN operation directive with parameters.

    * `:filename` is an optional filename you can add after a trailing slash /.


    You can stack two and more operations like this:

    ```-/:operation/:params/-/:operation/:params/```

    '
  contact:
    name: API support
    email: help@uploadcare.com
  x-logo:
    url: https://ucarecdn.com/12e3af14-392d-416f-8542-f210c2eb6ec4/logourlapi.svg
    backgroundColor: '#fafafa'
    altText: Uploadcare URL API Reference
  x-meta:
    title: URL API Reference — Uploadcare
    description: A reference documentation for the Uploadcare's URL API.
servers:
- url: https://ucarecdn.com
  description: Production server
tags:
- name: File information
  description: 'There are a few ways to get information about uploaded file.

    One of them is on-the-fly with a request to CDN.


    Note: Other APIs also let you read file info:

    [after Upload](/docs/api/upload/upload/file-upload-info)

    and [at REST](/docs/api/rest/file/info).

    '
paths:
  /{uuid}/-/json/:
    parameters:
    - $ref: '#/components/parameters/uuid'
    get:
      tags:
      - File information
      summary: File info as JSON
      description: 'Returns file-related information, such as image dimensions or geo

        tagging data in the JSON format.

        '
      operationId: fileInfoJson
      responses:
        '200':
          description: File
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
        '404':
          $ref: '#/components/responses/fileNotFoundError'
components:
  parameters:
    uuid:
      in: path
      description: Unique file identifier
      name: uuid
      required: true
      schema:
        type: string
        example: d7fe74ac-65b8-4ade-875f-ccd92759a70f
  examples:
    imageNotFound:
      externalValue: https://ucarecdn.com/d7fe74ac-65b8-4ade-875f-ccd92759a700/imageNotFound.jpg
  responses:
    fileNotFoundError:
      description: Image with "File not found" text.
      content:
        image/jpeg:
          schema:
            type: string
            format: binary
          examples:
            imageNotFound:
              $ref: '#/components/examples/imageNotFound'
  schemas:
    file:
      description: File object.
      type: object
      additionalProperties: false
      required:
      - id
      properties:
        id:
          description: File UUID.
          type: string
          format: uuid
          example: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46
          readOnly: true
        dpi:
          description: Image DPI for two dimensions.
          type: array
          nullable: true
          items:
            type: number
            example: 72
          minItems: 2
          maxItems: 2
          example:
          - 72
          - 72
          readOnly: true
        width:
          description: Image width in pixels.
          type: integer
          example: 2935
          readOnly: true
        format:
          description: Image format.
          type: string
          example: JPEG
          readOnly: true
        height:
          description: Image height in pixels.
          type: integer
          example: 2352
          readOnly: true
        sequence:
          description: Set to true if a file contains a sequence of images (GIF for example).
          type: boolean
          readOnly: true
        color_mode:
          description: Image color mode.
          type: string
          enum:
          - RGB
          - RGBA
          - RGBa
          - RGBX
          - L
          - LA
          - La
          - P
          - PA
          - CMYK
          - YCbCr
          - HSV
          - LAB
          example: RGBA
          readOnly: true
        orientation:
          description: Image orientation from EXIF.
          type: integer
          nullable: true
          minimum: 0
          maximum: 8
          example: 6
          readOnly: true
        geo_location:
          description: Geo-location of image from EXIF.
          type: object
          nullable: true
          required:
          - latitude
          - longitude
          properties:
            latitude:
              type: number
              description: Location latitude.
              example: -1.1884555555555556
            longitude:
              type: number
              description: Location longitude.
              example: 52.66996666666667
          readOnly: true
        datetime_original:
          description: Image date and time from EXIF. Please be aware that this data is not always formatted and displayed exactly as it appears in the EXIF.
          type: string
          nullable: true
          format: date-time
          example: '2018-09-13T16:23:40'
          readOnly: true
        hash:
          description: 'A 64-bit perceptual hash represented as a hexadecimal string,

            calculated from the image’s pixel content.

            Learn more about [Perceptual hash](/docs/cdn-operations/#operation-json-phash).

            '
          type: string
          nullable: true
          example: 940f5fd09aa48ddc
          readOnly: true
        blurhash:
          description: 'A compact string representation of the image, allowing reconstruction

            of its general structure and color scheme without details, useful

            as a blurred placeholder until the full image loads.

            Learn more about [Blurhash](/docs/cdn-operations/#operation-json-blurhash).

            '
          type: string
          nullable: true
          example: WXOfGPL~?vkpNGxv-CwdInXSt7V@?^%gRPkCofV@I;X9s:i{tRoy
          readOnly: true
      example:
        id: d7fe74ac-65b8-4ade-875f-ccd92759a70f
        dpi:
        - 300
        - 300
        width: 3432
        format: JPEG
        height: 3432
        sequence: false
        color_mode: RGB
        orientation: null
        geo_location: null
        datetime_original: '2020-06-07T10:38:16'
        hash: e98d9466a33a9c8b