# AliExpress Image Search (`bokgoon/aliexpress-image-search`) Actor

Find matching AliExpress products by uploading a product image or providing an image URL. Returns up to 60 results with prices, images, and direct product links.

- **URL**: https://apify.com/bokgoon/aliexpress-image-search.md
- **Developed by:** [군 복](https://apify.com/bokgoon) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AliExpress Image Search Actor

Search AliExpress for products matching a given image — no API key required. Upload a product photo or supply a public image URL and receive up to 60 matching product listings with prices, images, and direct links.

### Features

- **Image input** — base64-encoded image or any public image URL
- **Up to 60 results** per search
- **USD price column** for easy comparison across currencies
- **Configurable locale / country / currency** — works worldwide
- **Bot-challenge bypass** — handles AliExpress punish redirects automatically

### Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `imageUrl` | string | * | — | Public URL of the product image |
| `imageBase64` | string | * | — | Base64-encoded image (with or without `data:image/...;base64,` prefix) |
| `country` | string | | `KR` | ISO 3166-1 alpha-2 ship-to country (e.g. `US`, `GB`, `DE`) |
| `currency` | string | | `KRW` | ISO 4217 currency code for prices (e.g. `USD`, `EUR`) |
| `locale` | string | | `ko_KR` | Locale for product titles (e.g. `en_US`, `zh_CN`) |
| `lang` | string | | `ko` | Language code matching locale (e.g. `en`, `zh`) |
| `pageSize` | integer | | `60` | Number of results (1–60) |

*Either `imageUrl` or `imageBase64` must be provided.

#### Example input

```json
{
  "imageUrl": "https://example.com/shirt.jpg",
  "country": "US",
  "currency": "USD",
  "locale": "en_US",
  "lang": "en",
  "pageSize": 30
}
````

### Output

Each dataset item represents one AliExpress product:

```json
{
  "title": "Men's Casual Cotton Shirt",
  "imageUrl": "https://ae01.alicdn.com/kf/...",
  "price": 12.99,
  "currency": "USD",
  "priceUSD": 12.99,
  "orders": 3421,
  "productUrl": "https://www.aliexpress.com/item/1234567890.html"
}
```

| Field | Type | Description |
|---|---|---|
| `title` | string | Product title |
| `imageUrl` | string | Product thumbnail URL |
| `price` | number | Price in the requested currency |
| `currency` | string | Currency code of `price` |
| `priceUSD` | number | Approximate USD equivalent |
| `orders` | number | Reported sales / order count |
| `productUrl` | string | Direct AliExpress product page URL |

### Error handling

| Error code | Meaning |
|---|---|
| `SESSION_FAILED` | Could not obtain session token — possible IP block |
| `BLOCKED` | AliExpress bot detection bypassed failed |
| `SEARCH_FAILED` | MTOP API returned an error |

On failure the actor throws and logs the error code. Retrying with a different Apify proxy or after a short delay usually resolves transient blocks.

### Tips for best results

- Use a **clear, well-lit product photo** with the item centred and background minimal
- Avoid screenshots of product listings (the actor searches by visual similarity)
- For apparel, a plain-background photo produces significantly more matches
- The actor resizes images to 800×800 px automatically — no need to pre-process

### Legal

This actor interacts with AliExpress's public search interface in the same way a browser would. It does not bypass authentication or access non-public data. Use responsibly and in accordance with AliExpress's Terms of Service.

# Actor input Schema

## `imageUrl` (type: `string`):

Public URL of the product image to search for. Either this or imageBase64 is required.

## `imageBase64` (type: `string`):

Base64-encoded image string (with or without the data:image/...;base64, prefix). Either this or imageUrl is required.

## `country` (type: `string`):

ISO 3166-1 alpha-2 country code for shipping destination. Affects available products and pricing.

## `currency` (type: `string`):

ISO 4217 currency code for displayed prices. The priceUSD field always shows the approximate USD equivalent.

## `locale` (type: `string`):

Locale string used for product titles and descriptions (e.g. ko\_KR, en\_US, zh\_CN).

## `lang` (type: `string`):

BCP-47 language code (e.g. ko, en, zh). Should match the locale setting.

## `pageSize` (type: `integer`):

Maximum number of products to return. AliExpress returns up to 60 per search.

## Actor input object example

```json
{
  "imageUrl": "https://example.com/product.jpg",
  "country": "US",
  "currency": "USD",
  "locale": "en_US",
  "lang": "en",
  "pageSize": 60
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bokgoon/aliexpress-image-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("bokgoon/aliexpress-image-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call bokgoon/aliexpress-image-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=bokgoon/aliexpress-image-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AliExpress Image Search",
        "description": "Find matching AliExpress products by uploading a product image or providing an image URL. Returns up to 60 results with prices, images, and direct product links.",
        "version": "1.0",
        "x-build-id": "fHfI46jCTRxG6hpLn"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/bokgoon~aliexpress-image-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-bokgoon-aliexpress-image-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/bokgoon~aliexpress-image-search/runs": {
            "post": {
                "operationId": "runs-sync-bokgoon-aliexpress-image-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/bokgoon~aliexpress-image-search/run-sync": {
            "post": {
                "operationId": "run-sync-bokgoon-aliexpress-image-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "imageUrl": {
                        "title": "Image URL",
                        "type": "string",
                        "description": "Public URL of the product image to search for. Either this or imageBase64 is required."
                    },
                    "imageBase64": {
                        "title": "Image (Base64)",
                        "type": "string",
                        "description": "Base64-encoded image string (with or without the data:image/...;base64, prefix). Either this or imageUrl is required."
                    },
                    "country": {
                        "title": "Ship-to Country",
                        "type": "string",
                        "description": "ISO 3166-1 alpha-2 country code for shipping destination. Affects available products and pricing.",
                        "default": "KR"
                    },
                    "currency": {
                        "title": "Currency",
                        "type": "string",
                        "description": "ISO 4217 currency code for displayed prices. The priceUSD field always shows the approximate USD equivalent.",
                        "default": "KRW"
                    },
                    "locale": {
                        "title": "Locale",
                        "type": "string",
                        "description": "Locale string used for product titles and descriptions (e.g. ko_KR, en_US, zh_CN).",
                        "default": "ko_KR"
                    },
                    "lang": {
                        "title": "Language",
                        "type": "string",
                        "description": "BCP-47 language code (e.g. ko, en, zh). Should match the locale setting.",
                        "default": "ko"
                    },
                    "pageSize": {
                        "title": "Number of Results",
                        "minimum": 1,
                        "maximum": 60,
                        "type": "integer",
                        "description": "Maximum number of products to return. AliExpress returns up to 60 per search.",
                        "default": 60
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
