VI | EN
Message us on Messenger
Developer resources

Search targeting options (interest, location, locale…) — Facebook API

Targeting Search · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

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ần platform_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ùng GET /act_{account_id}/reachestimate.
  • Gọi thật: adlocale với q=Viet trả 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=adinterestvalid trước khi dùng id cũ.

Request

Endpoint

GET https://partner.quantri360.com/v1/facebook/{version}/search

Authentication & shop

NameInTypeSampleDescription
AuthorizationheaderheaderBearer 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_idquerystringact_123456789 hoặc 1234567890Tà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

NameInTypeRequiredSampleDescription
versionpathstringYesv25.0
platform_shop_idquerystringNoact_5924809560908319Tà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.
typequerystringYesadinterestadinterest · adinterestsuggestion (cần interest_list) · adinterestvalid · adgeolocation · adTargetingCategory (cần class) · adlocale · adeducationschool · adeducationmajor · adworkemployer · adworkposition.
qquerystringNothời trangChuỗi tìm (tự hoàn thành). Bắt buộc với đa số type; adTargetingCategory bỏ qua q.
location_typesquerystringNo["region","city"]Chỉ với adgeolocation: mảng JSON country · region · city · zip · geo_market …
country_codequerystringNoVNChỉ với adgeolocation: giới hạn trong một quốc gia.
classquerystringNobehaviorsChỉ với adTargetingCategory: interests · behaviors · demographics · life_events · industries · income · family_statuses · user_device · user_os.
interest_listquerystringNo["Thời trang"]Với adinterestsuggestion / adinterestvalid: mảng JSON tên sở thích.
limitqueryintNo25Số 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)

NameTypeSampleDescription
dataobject[]Kết quả — trường khác nhau theo `type`.
idstring6003348604581Sở thích / hành vi: id đưa vào `targeting.flexible_spec[].interests` / `behaviors`.
keystring2609615Đị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).
namestringPhụ 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_boundint978194413 / 1150356630Quy mô ước tính TOÀN CẦU (khoảng).
pathstring[]["Mối quan tâm","Phụ kiện thời trang (phụ kiện)"]Vị trí trong cây danh mục.
topicstringShopping and fashionChủ đề (sở thích).
type / country_code / region / region_idcity / VN / Hanoi / 3983Địa điểm: loại, quốc gia, tỉnh cha.
pagingobjectChỉ 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

  1. Sign up for Partner
  2. Enable a data type of the Quảng cáo (Marketing API) group on the platform page
  3. Create an API key (tick the Facebook channel)
  4. Call it as in the examples above