productAI

Regions

Supported Regions

ProductAI offers regional endpoints to reduce data latency in your applications.

The following table lists the regions and endpoints provided:

RegionEndpoint
China East (Hangzhou)api-cn-east-1.productai.cn
Asia Pacific (Hong Kong)api-ap-southeast-1.productai.com

China East is currently the default region, so if you do not specify a specific region, you’ll be using the services from that location. An alias endpoint for that region is api-cn-east-1.productai.cn.

For developers outside of Mainland China, it is recommended to use the Asia Pacific (Hong Kong) region, which is accessible via this endpoint: api-ap-southeast-1.productai.com.

Note: different regions support different services. Please contact with your account manager to confirm if the region you want has the desired service.

API

cURL

# An example using the default region (China East) 
curl -X POST \
-H 'x-ca-version: 1.0' \
-H 'x-ca-accesskeyid: ACCESS_KEY_ID' \
-d 'url=https://url/of/your/query.jpg' \
https://api.productai.com/search/SERVICE_ID

# Specifically set the China East (Hangzhou) region
curl -X POST \
-H 'x-ca-version: 1.0' \
-H 'x-ca-accesskeyid: ACCESS_KEY_ID' \
-d 'url=https://url/of/your/query.jpg' \
https://api-cn-east-1.productai.cn/search/SERVICE_ID

# Specifically set the Asia Pacific (Hong Kong) region:
curl -X POST \
-H 'x-ca-version: 1.0' \
-H 'x-ca-accesskeyid: ACCESS_KEY_ID' \
-d 'url=https://url/of/your/query.jpg' \
https://api-ap-southeast-1.productai.com/search/SERVICE_ID

SDK

Python

PHP

Java

C#

from productai import Client

# Specifically set the China East (Hangzhou) region:
cli = Client(ACCESS_KEY_ID, SECRET_KEY, url_root='https://api-cn-east-1.productai.cn')

# Specifically set the Asia Pacific (Hong Kong) region:
cli = Client(ACCESS_KEY_ID, SECRET_KEY)
cli.url_root = 'https://api-ap-southeast-1.productai.com'
use ProductAI;

$product_ai = new ProductAI\API($access_key_id=ACCESS_KEY_ID, $secret_key=SECRET_KEY);
$product_ai->api = 'https://api-ap-southeast-1.productai.com';
IProfile profile = new DefaultProfile();
profile.setAccessKeyId(ACCESS_KEY_ID);
profile.setSecretKey(SECRET_KEY);
profile.setVersion("1");


IWebClient client = new DefaultProductAIClient(profile);
client.setHost("api-ap-southeast-1.productai.com");
IProfile profile = new DefaultProfile
{
Version = "1",
AccessKeyId = ACCESS_KEY_ID,
SecretKey = SECRET_KEY,
};

var client = new DefaultProductAIClient(profile,"api-ap-southeast-1.productai.com");