# Search Stock Images

Searches stock photos for the email editor and returns candidate previews, licences and sizes. A search without a match may return unrelated photos. Stock URLs are not ready for email blocks; upload the chosen photo with upload-email-editor-image-from-url. Check licence restrictions for identifiable people.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "What the picture shows, one or two words, in English (the archives are indexed in English)",
      "minLength": 1,
      "maxLength": 100
    },
    "limit": {
      "type": [
        "null",
        "integer"
      ],
      "description": "How many candidates, 1 to 12; default 3",
      "default": null,
      "minimum": 1,
      "maximum": 12
    },
    "orientation": {
      "type": [
        "null",
        "string"
      ],
      "description": "Only photos of this shape: landscape, portrait or square; omit for any shape",
      "default": null,
      "enum": [
        "landscape",
        "portrait",
        "square"
      ]
    },
    "minWidth": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Only photos at least this wide, in pixels; 1200 for a full-width image",
      "default": null,
      "minimum": 1,
      "maximum": 10000
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "query",
    "count",
    "matchIsNotGuaranteed",
    "images",
    "html"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "query": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "matchIsNotGuaranteed": {
      "type": "boolean"
    },
    "images": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "previewUrl",
          "sourceUrl",
          "fileName",
          "provider",
          "license",
          "licenseUrl",
          "licenseNote",
          "width",
          "height",
          "orientation"
        ],
        "properties": {
          "previewUrl": {
            "type": "string"
          },
          "sourceUrl": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "license": {
            "type": [
              "string",
              "null"
            ]
          },
          "licenseUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "licenseNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "orientation": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "html": {
      "type": "string"
    }
  }
}
```

