Skip to content
Docs menu

List formats

Every input format with its targets and their minimum credits, plus up to three suggested targets with a short reason. No API key needed.

GEThttps://api.switchfile.io/v1/formats

No API key needed.

Example

curl "https://api.switchfile.io/v1/formats?input=heic"

Parameters

Query parameters

  • inputstring

    Return only this input format

    at most 20 characters · example: heic

Responses

  • 200OK
    • dataobject[]required
    • data[].formatstringrequired
    • data[].groupstring | nullrequired

      One of video, audio, image, document, spreadsheet, presentation, markup, font, archive, ebook, comic, pdf

    • data[].suggestedobject[]required
    • data[].suggested[].formatstringrequired
    • data[].suggested[].reasonstringrequired
    • data[].targetsobject[]required
    • data[].targets[].creditsstring (integer) | integerrequired

      Minimum credits per file

    • data[].targets[].formatstringrequired
    200 application/json
    {
      "data": [
        {
          "format": "heic",
          "group": "image",
          "targets": [
            {
              "format": "jpg",
              "credits": 1
            },
            {
              "format": "pdf",
              "credits": 1
            },
            {
              "format": "png",
              "credits": 1
            },
            {
              "format": "webp",
              "credits": 1
            }
          ],
          "suggested": [
            {
              "format": "jpg",
              "reason": "Opens on every device and in every app."
            },
            {
              "format": "png",
              "reason": "Keeps every detail, larger files."
            }
          ]
        }
      ]
    }
  • 422Invalid data. errors names the fields
    422 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-invalid-data",
      "title": "Invalid data",
      "status": 422,
      "code": "INVALID_DATA",
      "detail": "The request contains invalid data.",
      "errors": {
        "to": [
          "Expected string"
        ]
      }
    }
  • 429Too many requests or a daily quota is used up. See Retry-After
    429 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-rate-limit-exceeded",
      "title": "Rate limit exceeded",
      "status": 429,
      "code": "RATE_LIMIT_EXCEEDED",
      "detail": "Too many requests. Try again in 12 seconds."
    }

Error bodies and codes are explained in Errors.