> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkGenerateAltTextSuggestions

# Package: seo

# Namespace: TagsSuggestionsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/tag-suggestions-v1/bulk-generate-alt-text-suggestions.md

## Permission Scopes:
View SEO Settings: SCOPE.PROMOTE.VIEW-SEO

## Introduction

Generates alt text suggestions for up to 20 images in one call.

Every image must be Wix-hosted media and belong to a Wix-managed item of
the same type. Images are processed independently: the response reports
per-image success, and the call succeeds as long as at least 1 image
succeeded. A call where every image failed returns a `GENERATION_FAILED`
error. An image URL that isn't Wix-hosted rejects the whole request.

To generate alt text for a single image, call
[Generate Alt Text Suggestions](https://dev.wix.com/docs/api-reference/business-management/seo/tag-suggestions-v1/generate-alt-text-suggestions.md).

---

## REST API

### Schema

```
 Method: bulkGenerateAltTextSuggestions
 Description: Generates alt text suggestions for up to 20 images in one call.  Every image must be Wix-hosted media and belong to a Wix-managed item of the same type. Images are processed independently: the response reports per-image success, and the call succeeds as long as at least 1 image succeeded. A call where every image failed returns a `GENERATION_FAILED` error. An image URL that isn't Wix-hosted rejects the whole request.  To generate alt text for a single image, call [Generate Alt Text Suggestions](https://dev.wix.com/docs/api-reference/business-management/seo/tag-suggestions-v1/generate-alt-text-suggestions.md).
 URL: https://www.wixapis.com/seo/suggestions/v1/tag-suggestions/alt-text-bulk
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  images, itemType
 Method parameters: 
   param name: images | type: array<images> | description: The images to generate alt text for. | required: true | validation: maxItems 20
              - name: id | type: string | description: Your reference GUID for the image. Echoed back in the result so you can match suggestions to images. It isn't interpreted.  | validation: maxLength 1000
              - name: url | type: string | description: URL of the image file. Must be Wix-hosted media, meaning a URL on a Wix media domain such as `static.wixstatic.com`. Other hosts are rejected.  | validation: maxLength 1000, format WEB_URL
              - name: parentItemId | type: string | description: GUID of the Wix item the image belongs to, for example, a page GUID or a store product GUID, matching the request's `itemType`.  | validation: maxLength 100
   param name: itemType | type: itemType | description: Type of the Wix item the images belong to, as an SEO item type identifier. All images in one call must belong to items of the same type. For example, `STATIC_PAGE_V2` for a regular site page, `STORES_PRODUCT` for a store product, or `BLOG_POST` for a blog post. Other values are rejected. | required: true | validation: minLength 1, maxLength 100
 Return type: BulkGenerateAltTextSuggestionsResponse
  - name: results | type: array<BulkAltTextResult> | description: A result per requested image, in request order.  | read-only: true | validation: maxItems 20
     - name: imageId | type: string | description: Your reference GUID for the image, echoed from the request.  | read-only: true | validation: maxLength 1000
     - name: success | type: boolean | description: Whether alt text was generated for this image.  | read-only: true 
     - name: suggestions | type: array<string> | description: Suggested alt texts, best match first. Empty when `success` is `false`.  | read-only: true | validation: maxItems 5, maxLength 1000
  - name: successCount | type: integer | description: Number of images that got suggestions.  | read-only: true 
  - name: failureCount | type: integer | description: Number of images that failed. Failed images can be retried individually with [Generate Alt Text Suggestions](https://dev.wix.com/docs/api-reference/business-management/seo/tag-suggestions-v1/generate-alt-text-suggestions.md).  | read-only: true 

 Possible Errors:
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: QUOTA_LIMIT_REACHED | Description: The caller's generation quota is exhausted. Reserved for future metering and not currently returned.
   HTTP Code: 500 | Status Code: INTERNAL | Application Code: GENERATION_FAILED | Description: The AI generation pipeline failed for every requested image.


```

### Examples

### Generate alt text for several images of a store product
All images in one call belong to items of the same type. Each result echoes the `id` you sent, so you can match suggestions to images.

```curl
curl -X POST \
'https://www.wixapis.com/seo/suggestions/v1/tag-suggestions/alt-text-bulk' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "itemType": "STORES_PRODUCT",
  "images": [
    {
      "id": "front",
      "url": "https://static.wixstatic.com/media/11062b_5f0a1e4d2c8b4e7f9a3c6d1e8b2f4a7c~mv2.jpg",
      "parentItemId": "37915fe9-4975-4fcd-9703-e2790a5a31a5"
    },
    {
      "id": "back",
      "url": "https://static.wixstatic.com/media/11062b_9d2e7b1a4f6c48e3b5a7c0d2e4f6a8b1~mv2.jpg",
      "parentItemId": "37915fe9-4975-4fcd-9703-e2790a5a31a5"
    }
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.tagSuggestions.bulkGenerateAltTextSuggestions(images, options)
 Description: Generates alt text suggestions for up to 20 images in one call.  Every image must be Wix-hosted media and belong to a Wix-managed item of the same type. Images are processed independently: the response reports per-image success, and the call succeeds as long as at least 1 image succeeded. A call where every image failed returns a `GENERATION_FAILED` error. An image URL that isn't Wix-hosted rejects the whole request.  To generate alt text for a single image, call [Generate Alt Text Suggestions](https://dev.wix.com/docs/api-reference/business-management/seo/tag-suggestions-v1/generate-alt-text-suggestions.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  images, options.itemType, options
 Method parameters: 
   param name: images | type: array<array> | description: The images to generate alt text for. | required: true | validation: maxItems 20
              - name: _id | type: string | description: Your reference GUID for the image. Echoed back in the result so you can match suggestions to images. It isn't interpreted.  | validation: maxLength 1000
              - name: url | type: string | description: URL of the image file. Must be Wix-hosted media, meaning a URL on a Wix media domain such as `static.wixstatic.com`. Other hosts are rejected.  | validation: maxLength 1000, format WEB_URL
              - name: parentItemId | type: string | description: GUID of the Wix item the image belongs to, for example, a page GUID or a store product GUID, matching the request's `itemType`.  | validation: maxLength 100
   param name: options | type: BulkGenerateAltTextSuggestionsOptions  none | required: true 
        - name: itemType | type: string | description: Type of the Wix item the images belong to, as an SEO item type identifier. All images in one call must belong to items of the same type. For example, `STATIC_PAGE_V2` for a regular site page, `STORES_PRODUCT` for a store product, or `BLOG_POST` for a blog post. Other values are rejected. | required: true | validation: minLength 1, maxLength 100
 Return type: PROMISE<BulkGenerateAltTextSuggestionsResponse>
  - name: results | type: array<BulkAltTextResult> | description: A result per requested image, in request order.  | read-only: true | validation: maxItems 20
     - name: imageId | type: string | description: Your reference GUID for the image, echoed from the request.  | read-only: true | validation: maxLength 1000
     - name: success | type: boolean | description: Whether alt text was generated for this image.  | read-only: true 
     - name: suggestions | type: array<string> | description: Suggested alt texts, best match first. Empty when `success` is `false`.  | read-only: true | validation: maxItems 5, maxLength 1000
  - name: successCount | type: integer | description: Number of images that got suggestions.  | read-only: true 
  - name: failureCount | type: integer | description: Number of images that failed. Failed images can be retried individually with [Generate Alt Text Suggestions](https://dev.wix.com/docs/api-reference/business-management/seo/tag-suggestions-v1/generate-alt-text-suggestions.md).  | read-only: true 

 Possible Errors:
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: QUOTA_LIMIT_REACHED | Description: The caller's generation quota is exhausted. Reserved for future metering and not currently returned.
   HTTP Code: 500 | Status Code: INTERNAL | Application Code: GENERATION_FAILED | Description: The AI generation pipeline failed for every requested image.


```

### Examples

### Generate alt text for several images of a store product
All images in one call belong to items of the same type. Each result echoes the `_id` you sent, so you can match suggestions to images.

```javascript
import { tagSuggestions } from "@wix/seo";

async function bulkGenerateAltTextSuggestions() {
  const response = await tagSuggestions.bulkGenerateAltTextSuggestions(
    [
      {
        _id: "front",
        url: "https://static.wixstatic.com/media/11062b_5f0a1e4d2c8b4e7f9a3c6d1e8b2f4a7c~mv2.jpg",
        parentItemId: "37915fe9-4975-4fcd-9703-e2790a5a31a5",
      },
      {
        _id: "back",
        url: "https://static.wixstatic.com/media/11062b_9d2e7b1a4f6c48e3b5a7c0d2e4f6a8b1~mv2.jpg",
        parentItemId: "37915fe9-4975-4fcd-9703-e2790a5a31a5",
      },
    ],
    {
      itemType: "STORES_PRODUCT",
    },
  );
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "imageId": "front",
 *       "success": true,
 *       "suggestions": [
 *         "White classic cotton t-shirt, front view",
 *         "Classic white crew-neck t-shirt on a plain background"
 *       ]
 *     },
 *     {
 *       "imageId": "back",
 *       "success": true,
 *       "suggestions": [
 *         "Back view of a white classic cotton t-shirt",
 *         "Plain white t-shirt seen from behind"
 *       ]
 *     }
 *   ],
 *   "successCount": 2,
 *   "failureCount": 0
 * }
 */

```

### bulkGenerateAltTextSuggestions (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { tagSuggestions } from '@wix/seo';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { tagSuggestions },
  // Include the auth strategy and host as relevant
});


async function bulkGenerateAltTextSuggestions(images,options) {
  const response = await myWixClient.tagSuggestions.bulkGenerateAltTextSuggestions(images,options);
};
```

---