Targeting Search
GET/{version}/searchVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/search
Coming soon. This API already runs in production through 360 and pricing is being finalised — you can read the docs and prepare your integration now.
Description
Tra cứu giá trị nhắm mục tiêu theo type: sở thích (adinterest), địa điểm (adgeolocation), danh mục hành vi / nhân khẩu (adTargetingCategory), ngôn ngữ (adlocale), trường học, nơi làm… Trả id / key để đưa vào targeting của nhóm quảng cáo, kèm quy mô đối tượng ước tính.
- Không có
act_<id>trong đường dẫn → 360 cầnplatform_shop_idđể chọn token. - Quy mô (
audience_size_*) là toàn cầu, không theo Việt Nam — muốn quy mô theo khu vực dùngGET /act_{account_id}/reachestimate. - Gọi thật:
adlocalevớiq=Viettrả rỗng — thử tên tiếng Anh (Vietnamese). - Sở thích có thể bị Meta ngừng (đang ngừng vẫn chạy nhưng không tạo / sửa nhóm được) — kiểm bằng
type=adinterestvalidtrước khi dùng id cũ.
Request
Endpoint
GET https://partner.quantri360.com/v1/facebook/{version}/search
Authentication & shop
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | act_123456789 hoặc 1234567890 | Tài sản Facebook brand đã nối với 360: tài khoản quảng cáo (act_<id> hoặc <id>), Page id hoặc Pixel id — lấy ở GET /v1/platforms. Có thể bỏ khi đường dẫn đã chứa act_<id> / page id của brand. |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| version | path | string | Yes | v25.0 | |
| platform_shop_id | query | string | No | act_5924809560908319 | Tài khoản quảng cáo dùng để gọi, dạng act_<id>. Đường dẫn không chứa tài khoản nên PHẢI gửi khi brand nối nhiều tài sản Facebook. |
| type | query | string | Yes | adinterest | adinterest · adinterestsuggestion (cần interest_list) · adinterestvalid · adgeolocation · adTargetingCategory (cần class) · adlocale · adeducationschool · adeducationmajor · adworkemployer · adworkposition. |
| q | query | string | No | thời trang | Chuỗi tìm (tự hoàn thành). Bắt buộc với đa số type; adTargetingCategory bỏ qua q. |
| location_types | query | string | No | ["region","city"] | Chỉ với adgeolocation: mảng JSON country · region · city · zip · geo_market … |
| country_code | query | string | No | VN | Chỉ với adgeolocation: giới hạn trong một quốc gia. |
| class | query | string | No | behaviors | Chỉ với adTargetingCategory: interests · behaviors · demographics · life_events · industries · income · family_statuses · user_device · user_os. |
| interest_list | query | string | No | ["Thời trang"] | Với adinterestsuggestion / adinterestvalid: mảng JSON tên sở thích. |
| limit | query | int | No | 25 | Số kết quả (mặc định 8). |
Pagination
Có paging.next khi còn kết quả (ví dụ adgeolocation): thêm after = paging.cursors.after.
Request examples
curl -s "https://partner.quantri360.com/v1/facebook/v25.0/search?platform_shop_id=act_5924809560908319&type=adinterest&q=th%E1%BB%9Di%20trang&limit=25" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/facebook/v25.0/search",
params={
"platform_shop_id": "act_5924809560908319",
"type": "adinterest",
"q": "thời trang",
"limit": 25
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/facebook/v25.0/search');
for (const [k, v] of Object.entries({"platform_shop_id":"act_5924809560908319","type":"adinterest","q":"thời trang","limit":25})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());PHP
<?php $key = 'q360_live_...'; // khóa API của brand $url = 'https://partner.quantri360.com/v1/facebook/v25.0/search' . '?' . http_build_query(['platform_shop_id' => 'act_5924809560908319', 'type' => 'adinterest', 'q' => 'thời trang', 'limit' => 25]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]); $res = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status, "\n", $res;
Response
Response fields (as returned by Facebook)
| Name | Type | Sample | Description |
|---|---|---|---|
| data | object[] | Kết quả — trường khác nhau theo `type`. | |
| id | string | 6003348604581 | Sở thích / hành vi: id đưa vào `targeting.flexible_spec[].interests` / `behaviors`. |
| key | string | 2609615 | Địa điểm / ngôn ngữ: khóa đưa vào `targeting.geo_locations` / `locales` (dùng `key`, không dùng tên — tên có thể đổi). |
| name | string | Phụ kiện thời trang (phụ kiện) | Tên theo ngôn ngữ người ủy quyền. |
| audience_size_lower_bound / audience_size_upper_bound | int | 978194413 / 1150356630 | Quy mô ước tính TOÀN CẦU (khoảng). |
| path | string[] | ["Mối quan tâm","Phụ kiện thời trang (phụ kiện)"] | Vị trí trong cây danh mục. |
| topic | string | Shopping and fashion | Chủ đề (sở thích). |
| type / country_code / region / region_id | city / VN / Hanoi / 3983 | Địa điểm: loại, quốc gia, tỉnh cha. | |
| paging | object | Chỉ có với một số type. |
Response sample
{
"data": [
{
"id": "6003348604581",
"name": "Phụ kiện thời trang (phụ kiện)",
"audience_size_lower_bound": 978194413,
"audience_size_upper_bound": 1150356630,
"path": [
"Mối quan tâm",
"Phụ kiện thời trang (phụ kiện)"
],
"description": "",
"topic": "Shopping and fashion"
},
{
"id": "6004107864209",
"name": "Thời trang cao cấp (trang phục)",
"audience_size_lower_bound": 79731802,
"audience_size_upper_bound": 93764600,
"path": [
"Mối quan tâm",
"Sở thích bổ sung"
],
"description": null,
"topic": "Shopping and fashion"
}
]
}
Get started
- Sign up for Partner
- Enable a data type of the Quảng cáo (Marketing API) group on the platform page
- Create an API key (tick the Facebook channel)
- Call it as in the examples above