---
title: "AliExpress Pencarian Produk API (V1)"
description: "Cari produk di AliExpress dengan pengaturan kueri opsional seperti halaman, sortir, kategori, merek, lokasi, atribut, harga, lokasi, wilayah, dan kontrol mata uang. Gunakan untuk penemuan produk, penelitian katalog, dan analisis variasi pasar."
lastUpdated: false
aiUsagePrompt: true
---

# AliExpress Pencarian Produk API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/aliexpress/search-products/v1\"")'
  :summary='JSON.parse("\"Pencarian Produk (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/aliexpress/product-search-v1-id.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Token autentikasi untuk layanan API ini.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"q\",\"in\":\"query\",\"description\":\"Kueri pencarian produk.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"page\",\"in\":\"query\",\"description\":\"Nomor halaman berbasis satu untuk pagination.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"sort\",\"in\":\"query\",\"description\":\"Urutan sort untuk hasil pencarian produk.\\n\\nNilai yang tersedia:\\n- `default`: Urutan hasil default\\n- `salesDesc`: Volume penjualan, tertinggi terlebih dahulu\\n- `priceAsc`: Harga, terendah terlebih dahulu\\n- `priceDesc`: Harga, tertinggi terlebih dahulu\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"default\",\"description\":\"Urutan penyortakan pencarian produk AliExpress\",\"enum\":[\"default\",\"salesDesc\",\"priceAsc\",\"priceDesc\"]}},{\"name\":\"catId\",\"in\":\"query\",\"description\":\"ID kategori yang digunakan untuk memfilter hasil pencarian produk.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"brandId\",\"in\":\"query\",\"description\":\"ID merek yang digunakan untuk memfilter hasil pencarian produk.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"loc\",\"in\":\"query\",\"description\":\"Filtro lokasi untuk hasil pencarian produk.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"switches\",\"in\":\"query\",\"description\":\"Swaitera pencarian yang digunakan untuk memilih fitur hasil yang opsional.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"attr\",\"in\":\"query\",\"description\":\"Filtro atribut produk untuk hasil pencarian.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"startPrice\",\"in\":\"query\",\"description\":\"Filtro harga produk minimum, termasuk.\",\"required\":false,\"schema\":{\"type\":\"number\",\"format\":\"double\"}},{\"name\":\"endPrice\",\"in\":\"query\",\"description\":\"Filtro harga produk maksimum, termasuk.\",\"required\":false,\"schema\":{\"type\":\"number\",\"format\":\"double\"}},{\"name\":\"locale\",\"in\":\"query\",\"description\":\"Lokasi yang digunakan untuk respons AliExpress.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"region\",\"in\":\"query\",\"description\":\"Wilayah pasar AliExpress.\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"currency\",\"in\":\"query\",\"description\":\"Kode mata uang yang digunakan untuk harga produk.\",\"required\":false,\"schema\":{\"type\":\"string\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Hasil pencarian produk AliExpress dan metadata pencarian.\",\"properties\":{\"result\":{\"type\":\"object\",\"description\":\"Hasil pencarian dengan metadata dan entri produk.\",\"properties\":{\"base\":{\"type\":\"object\",\"description\":\"Metadata pencarian yang dilaporkan bersama hasilnya.\",\"properties\":{\"q\":{\"type\":\"string\",\"description\":\"Kueri pencarian yang dilaporkan dalam metadata hasil.\"},\"totalResults\":{\"type\":\"string\",\"description\":\"Jumlah total hasil yang dilaporkan sebagai teks.\"},\"pageSize\":{\"type\":\"string\",\"description\":\"Ukuran halaman yang dilaporkan sebagai teks. Daftar yang diberikan dapat berisi lebih sedikit entri.\"},\"sortValues\":{\"type\":\"array\",\"description\":\"Opsi sort yang dilaporkan untuk pencarian produk.\",\"items\":{\"type\":\"string\",\"description\":\"Satu nilai sort yang didukung yang dilaporkan dalam hasil pencarian.\"}},\"switchesList\":{\"type\":\"array\",\"description\":\"Daftar pengaturan pencarian yang dilaporkan. Daftar tersebut kosong dalam respons yang terverifikasi.\"}}},\"resultList\":{\"type\":\"array\",\"description\":\"Entri produk di halaman yang dikembalikan.\",\"items\":{\"type\":\"object\",\"description\":\"Satu entri dalam hasil pencarian produk.\",\"properties\":{\"item\":{\"type\":\"object\",\"description\":\"Informasi produk untuk entri hasil pencarian ini.\",\"properties\":{\"itemId\":{\"type\":\"string\",\"description\":\"Identifikasi produk AliExpress yang dikembalikan sebagai teks.\"},\"title\":{\"type\":\"string\",\"description\":\"Judul yang dikembalikan untuk listing produk.\"},\"itemUrl\":{\"type\":\"string\",\"description\":\"URL listing AliExpress. Bisa dimulai dengan // dan tidak perlu menyertakan skema.\"},\"image\":{\"type\":\"string\",\"description\":\"URL gambar yang dikembalikan untuk listing produk.\"},\"sales\":{\"type\":[\"integer\",\"string\"],\"description\":\"Jumlah penjualan yang dilaporkan, dikembalikan sebagai bilangan bulat atau teks yang ditampilkan.\"},\"averageStarRate\":{\"type\":[\"number\",\"null\"],\"description\":\"Penilaian bintang rata-rata yang dilaporkan untuk produk, yang bisa null.\"},\"type\":{\"type\":\"string\",\"description\":\"Label jenis hasil produk yang dilaporkan oleh AliExpress.\"},\"sku\":{\"type\":\"object\",\"description\":\"Informasi SKU yang dikembalikan bersama produk.\",\"properties\":{\"def\":{\"type\":\"object\",\"description\":\"Informasi harga untuk SKU default.\",\"properties\":{\"promotionPrice\":{\"type\":\"number\",\"description\":\"Harga promosi yang dilaporkan untuk SKU default dalam bentuk angka.\"},\"price\":{\"description\":\"Field harga SKU default menjadi null pada entri produk yang terpilih.\"}}}}}}},\"delivery\":{\"description\":\"Field pengiriman menjadi null pada entri produk yang terpilih.\"},\"sellingPoints\":{\"description\":\"Field poin penjualan menjadi null pada entri produk yang terpilih.\"}}}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Parameter atau isi permintaan yang tidak valid\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Token akses yang tidak valid atau tidak aktif\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Izin ditolak\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Laju permintaan atau batas kuota harian terlampaui\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Kesalahan server internal\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Layanan sementara tidak tersedia\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"API produksi global (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/aliexpress/search-products/v1\"")' />

<p>Cari produk di AliExpress dengan pengaturan kueri opsional seperti halaman, sortir, kategori, merek, lokasi, atribut, harga, lokasi, wilayah, dan kontrol mata uang. Gunakan untuk penemuan produk, penelitian katalog, dan analisis variasi pasar.</p>

## Parameter

<div class="api-doc-table api-doc-table--params">

| Nama | Lokasi | Jenis | Wajib | Bawaan | Deskripsi |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Ya | - | Token autentikasi untuk layanan API ini. |
| <code>q</code> | query | <code>string</code> | Tidak | - | Kueri pencarian produk. |
| <code>page</code> | query | <code>string</code> | Tidak | - | Nomor halaman berbasis satu untuk pagination. |
| <code>sort</code> | query | <code>string</code> | Tidak | <code>default</code> | Urutan sort untuk hasil pencarian produk.<br /><br><br>Nilai yang tersedia:<br /><br>- <code>default</code>: Urutan hasil default<br /><br>- <code>salesDesc</code>: Volume penjualan, tertinggi terlebih dahulu<br /><br>- <code>priceAsc</code>: Harga, terendah terlebih dahulu<br /><br>- <code>priceDesc</code>: Harga, tertinggi terlebih dahulu |
| <code>catId</code> | query | <code>string</code> | Tidak | - | ID kategori yang digunakan untuk memfilter hasil pencarian produk. |
| <code>brandId</code> | query | <code>string</code> | Tidak | - | ID merek yang digunakan untuk memfilter hasil pencarian produk. |
| <code>loc</code> | query | <code>string</code> | Tidak | - | Filtro lokasi untuk hasil pencarian produk. |
| <code>switches</code> | query | <code>string</code> | Tidak | - | Swaitera pencarian yang digunakan untuk memilih fitur hasil yang opsional. |
| <code>attr</code> | query | <code>string</code> | Tidak | - | Filtro atribut produk untuk hasil pencarian. |
| <code>startPrice</code> | query | <code>number</code> | Tidak | - | Filtro harga produk minimum, termasuk. |
| <code>endPrice</code> | query | <code>number</code> | Tidak | - | Filtro harga produk maksimum, termasuk. |
| <code>locale</code> | query | <code>string</code> | Tidak | - | Lokasi yang digunakan untuk respons AliExpress. |
| <code>region</code> | query | <code>string</code> | Tidak | - | Wilayah pasar AliExpress. |
| <code>currency</code> | query | <code>string</code> | Tidak | - | Kode mata uang yang digunakan untuk harga produk. |

</div>

## Contoh Kode

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/aliexpress/search-products/v1?token=YOUR_API_KEY'
```

```text [🤖 Prompt AI]
Saya ingin menggunakan API "Pencarian Produk (V1)" dari JustOneAPI.
URL dasar: https://api.justoneapi.com.
Jalur API: /api/aliexpress/search-products/v1?token=YOUR_API_KEY
Endpoint API: BASE_URL + /api/aliexpress/search-products/v1?token=YOUR_API_KEY
Metode HTTP: GET
Autentikasi: Tambahkan parameter query "token" ke URL.
Definisi OpenAPI: https://docs.justoneapi.com/openapi/aliexpress/product-search-v1-id.json

Parameter:
- token (query): Token autentikasi untuk layanan API ini. (Wajib)
- q (query): Kueri pencarian produk.
- page (query): Nomor halaman berbasis satu untuk pagination.
- sort (query): Urutan sort untuk hasil pencarian produk.

Nilai yang tersedia:
- `default`: Urutan hasil default
- `salesDesc`: Volume penjualan, tertinggi terlebih dahulu
- `priceAsc`: Harga, terendah terlebih dahulu
- `priceDesc`: Harga, tertinggi terlebih dahulu
- catId (query): ID kategori yang digunakan untuk memfilter hasil pencarian produk.
- brandId (query): ID merek yang digunakan untuk memfilter hasil pencarian produk.
- loc (query): Filtro lokasi untuk hasil pencarian produk.
- switches (query): Swaitera pencarian yang digunakan untuk memilih fitur hasil yang opsional.
- attr (query): Filtro atribut produk untuk hasil pencarian.
- startPrice (query): Filtro harga produk minimum, termasuk.
- endPrice (query): Filtro harga produk maksimum, termasuk.
- locale (query): Lokasi yang digunakan untuk respons AliExpress.
- region (query): Wilayah pasar AliExpress.
- currency (query): Kode mata uang yang digunakan untuk harga produk.

Format Kembalian: tangani dengan aman JSON atau teks sesuai dengan Content-Type yang sebenarnya.

Penanganan respons dan kode kesalahan:
1. Tentukan hasil pemrosesan dari kolom "code" dalam isi respons (code 0 berarti berhasil).
2. Batas waktu yang disarankan: Atur batas waktu permintaan menjadi 120 detik. Jika 120 detik terlalu lama untuk kebutuhan Anda, gunakan setidaknya 60 detik. Sebagian kecil permintaan mungkin mencapai batas waktu sebelum hasil diterima.
3. Kode hasil:
   - 0: Berhasil
   - 100: Token tidak valid atau tidak aktif
   - 301: Gagal mengambil data. Silakan coba lagi.
   - 302: Batas frekuensi permintaan terlampaui
   - 303: Kuota harian terlampaui
   - 400: Parameter tidak valid
   - 500: Kesalahan internal server
   - 600: Akses ditolak
   - 601: Saldo tidak mencukupi
   - 602: Batas anggaran token tercapai
4. Kode 601 berarti saldo bersama akun tidak mencukupi. Kode 602 berarti token API yang digunakan telah mencapai batas anggaran kumulatifnya sendiri. Menetapkan batas anggaran token tidak memindahkan dana dari saldo bersama akun.

Tolong bantu saya menulis skrip dalam bahasa pemrograman favorit saya untuk memanggil API ini dan menangani responsnya.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Diberikan oleh server OpenAPI

url = BASE_URL + "/api/aliexpress/search-products/v1?token=YOUR_API_KEY"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
const url = BASE_URL + "/api/aliexpress/search-products/v1?token=YOUR_API_KEY";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
        final String url = BASE_URL + "/api/aliexpress/search-products/v1?token=YOUR_API_KEY";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Diberikan oleh server OpenAPI

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/aliexpress/search-products/v1?token=YOUR_API_KEY"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Diberikan oleh server OpenAPI
$url = $BASE_URL . '/api/aliexpress/search-products/v1?token=YOUR_API_KEY';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/aliexpress/product-search-v1-id.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[Definisi OpenAPI (JSON)]</a>
</div>

## Field Respons

Field Kunci dalam respons yang sukses (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Jalur Field | Jenis | Deskripsi |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | Hasil pencarian produk AliExpress dan metadata pencarian. |
| <code>data.result</code> | <code>object</code> | Hasil pencarian dengan metadata dan entri produk. |
| <code>data.result.base</code> | <code>object</code> | Metadata pencarian yang dilaporkan bersama hasilnya. |
| <code>data.result.base.q</code> | <code>string</code> | Kueri pencarian yang dilaporkan dalam metadata hasil. |
| <code>data.result.base.totalResults</code> | <code>string</code> | Jumlah total hasil yang dilaporkan sebagai teks. |
| <code>data.result.base.pageSize</code> | <code>string</code> | Ukuran halaman yang dilaporkan sebagai teks. Daftar yang diberikan dapat berisi lebih sedikit entri. |
| <code>data.result.base.sortValues</code> | <code>array</code> | Opsi sort yang dilaporkan untuk pencarian produk. |
| <code>data.result.base.sortValues[]</code> | <code>string</code> | Satu nilai sort yang didukung yang dilaporkan dalam hasil pencarian. |
| <code>data.result.base.switchesList</code> | <code>array</code> | Daftar pengaturan pencarian yang dilaporkan. Daftar tersebut kosong dalam respons yang terverifikasi. |
| <code>data.result.resultList</code> | <code>array</code> | Entri produk di halaman yang dikembalikan. |
| <code>data.result.resultList[]</code> | <code>object</code> | Satu entri dalam hasil pencarian produk. |
| <code>data.result.resultList[].item</code> | <code>object</code> | Informasi produk untuk entri hasil pencarian ini. |
| <code>data.result.resultList[].item.itemId</code> | <code>string</code> | Identifikasi produk AliExpress yang dikembalikan sebagai teks. |
| <code>data.result.resultList[].item.title</code> | <code>string</code> | Judul yang dikembalikan untuk listing produk. |
| <code>data.result.resultList[].item.itemUrl</code> | <code>string</code> | URL listing AliExpress. Bisa dimulai dengan // dan tidak perlu menyertakan skema. |
| <code>data.result.resultList[].item.image</code> | <code>string</code> | URL gambar yang dikembalikan untuk listing produk. |
| <code>data.result.resultList[].item.sales</code> | <code>integer &#124; string</code> | Jumlah penjualan yang dilaporkan, dikembalikan sebagai bilangan bulat atau teks yang ditampilkan. |
| <code>data.result.resultList[].item.averageStarRate</code> | <code>number &#124; null</code> | Penilaian bintang rata-rata yang dilaporkan untuk produk, yang bisa null. |
| <code>data.result.resultList[].item.type</code> | <code>string</code> | Label jenis hasil produk yang dilaporkan oleh AliExpress. |
| <code>data.result.resultList[].item.sku</code> | <code>object</code> | Informasi SKU yang dikembalikan bersama produk. |
| <code>data.result.resultList[].item.sku.def</code> | <code>object</code> | Informasi harga untuk SKU default. |
| <code>data.result.resultList[].item.sku.def.promotionPrice</code> | <code>number</code> | Harga promosi yang dilaporkan untuk SKU default dalam bentuk angka. |
| <code>data.result.resultList[].item.sku.def.price</code> | - | Field harga SKU default menjadi null pada entri produk yang terpilih. |
| <code>data.result.resultList[].delivery</code> | - | Field pengiriman menjadi null pada entri produk yang terpilih. |
| <code>data.result.resultList[].sellingPoints</code> | - | Field poin penjualan menjadi null pada entri produk yang terpilih. |

</div>

## Contoh Respons

<ApiExampleSection :api='JSON.parse("\"/api/aliexpress/search-products/v1\"")' />

