> ## Documentation Index
> Fetch the complete documentation index at: https://docs.copyfy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# find_supplier

> Find AliExpress or Alibaba suppliers for a product from its image, with an estimated margin.

Finds suppliers for a product on AliExpress or Alibaba by searching with its image, like the supplier search of the product drawer in the dashboard. Each supplier comes with its listing link, price, minimum order, orders, rating, and an estimated margin against your selling price.

**Cost:** 1 credit per successful call.

## Arguments

| Argument | Type | Allowed values |
| - | - | - |
| `product_id` | integer or numeric string | Copyfy product id, from [`search_products`](https://docs.copyfy.io/tools/search-products), [`get_product`](https://docs.copyfy.io/tools/get-product), or [`get_shop`](https://docs.copyfy.io/tools/get-shop). Copyfy searches with its main image and uses its lowest price as the selling price. |
| `image_url` | string | Direct https link to a product image ending in `.jpg`, `.jpeg`, `.png`, `.gif`, or `.webp`, for example an ad `image_url` from [`search_ads`](https://docs.copyfy.io/tools/search-ads). |
| `selling_price` | number | Selling price used for the margin. Default: the product's lowest price when you pass `product_id`. |
| `platform` | enum | `aliexpress` (default), `alibaba`, or `both`. |
| `language` | enum | `en` (default) or `fr`: the language of the supplier listings. |
| `limit` | integer | Suppliers to return, 1 to 20. Default: `10`. |

Pass `product_id` or `image_url`, not both.

## Example

```json Tool call theme={null}
{
  "name": "find_supplier",
  "arguments": { "product_id": 4419021, "limit": 1 }
}
```

```json Result theme={null}
{
  "source": {
    "product_id": 4419021,
    "title": "Self-cleaning pet brush",
    "image_url": "https://cdn.shopify.com/s/files/1/0000/products/brush.jpg",
    "selling_price": 29.9,
    "currency": "USD"
  },
  "platform": "aliexpress",
  "suppliers": [
    {
      "platform": "aliexpress",
      "item_id": "1005006010101",
      "title": "Self-cleaning slicker brush for dogs and cats",
      "url": "https://www.aliexpress.com/item/1005006010101.html",
      "image_url": "https://ae01.alicdn.com/kf/brush.jpg",
      "price": 4.8,
      "min_order": "1 piece",
      "orders": 1240,
      "rating": 4.7,
      "estimated_margin_pct": 84
    }
  ],
  "margin_basis": "estimated_margin_pct = (selling price - supplier price) / selling price, before shipping, fees and taxes, as in the Copyfy dashboard."
}
```

## Result fields

| Field | Type | Description |
| - | - | - |
| `source` | object | The searched image and the selling price used for margins: `product_id`, `title`, `image_url`, `selling_price`, `currency`. |
| `suppliers` | array | `platform`, `item_id`, `title` (third-party content), `url`, `image_url`, `price`, `min_order`, `orders`, `rating`, `estimated_margin_pct`. |
| `margin_basis` | string | How the margin is computed. |
| `notice` | string | Present when no selling price is known, when the store's currency is not USD (supplier prices usually come in USD and the margin compares them without conversion), or when Alibaba did not answer a `both` search and the results only come from AliExpress. |

## Errors

| Code | When |
| - | - |
| [`invalid_arguments`](https://docs.copyfy.io/errors#invalid_arguments) | Both or neither of `product_id` and `image_url`, or an `image_url` that is not a public direct image link. |
| [`not_found`](https://docs.copyfy.io/errors#not_found) | No Copyfy product has this id, the product or its store is no longer available, or the product has no image. |
| [`media_unavailable`](https://docs.copyfy.io/errors#media_unavailable) | The product's image is not a public direct image link the supplier search can use. Pass another image of the product as `image_url`. |
| [`search_unavailable`](https://docs.copyfy.io/errors#search_unavailable) | The supplier search failed or timed out, including when every platform you asked for is down. |
| [`feature_unavailable`](https://docs.copyfy.io/errors#feature_unavailable) | Supplier search is switched off. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.