การค้นหาการกำหนดเป้าหมาย

กำหนดเป้าหมายชุดโฆษณาตามจำนวนเกณฑ์ที่คุณระบุไว้ในข้อมูลจำเพาะของการกำหนดเป้าหมาย เป้าหมายส่วนใหญ่จะได้รับการกำหนดค่าไว้ล่วงหน้า เช่น ประเทศ "ญี่ปุ่น" หรือเมือง "โตเกียว"

ค้นหาค่าที่ถูกต้องด้วย API การตลาด, การค้นหาการกำหนดเป้าหมาย: https://graph.facebook.com/{API_VERSION}/search โดยคุณจะต้องระบุสตริงการสืบค้นในรูปแบบ UTF8

สถานะตัวเลือกในการกำหนดเป้าหมาย

หากต้องการตรวจสอบยืนยันสถานะของการกำหนดเป้าหมายอ็อบเจ็กต์ในปัจจุบันและ/หรือที่วางแผนไว้ ให้ใช้พารามิเตอร์ targeting_option_list

curl -G \
  -d 'targeting_option_list=[<TARGETING_OPTION_ ID>,<TARGETING_OPTION_ID>]' 
  -d 'type=targetingoptionstatus'  
  https://graph.facebook.com/<API_VERSION>/search

การตอบกลับ

{"data":[{"id":"<TARGETING_OPTION_ ID>","current_status":"NON-DELIVERABLE"},{"id":"<TARGETING_OPTION_ID>","current_status":"NON-DELIVERABLE","future_plan":[{"key":"2018-05-10T00:00:00+0000","value":"DEPRECATING"}]}]

ช่องที่ส่งกลับ

ช่องค่า

current_status

  • NORMAL
  • NON-DELIVERABLE - ไม่แสดง แม้ว่าชุดโฆษณาอาจแสดงต่อไปตามกฎที่กำหนดไว้ล่วงหน้าก็ตาม
  • DEPRECATING - ชุดโฆษณาที่กำหนดเป้าหมายไปที่วัตถุประสงค์นี้จะยังแสดงต่อไป แต่ไม่สามารถใช้อ็อบเจ็กต์นี้เพื่อสร้างชุดโฆษณาใหม่หรืออัพเดตชุดโฆษณาได้ เมื่อได้รับการอัพเดต ชุดโฆษณาที่มีคำนี้จะถูกปฏิเสธ เว้นแต่ว่าจะลบคำสำคัญออก
  • INCLUSION-ONLY - ไม่สามารถใช้อ็อบเจ็กต์ในการยกเว้นการกำหนดเป้าหมายได้
  • UNKNOWN

future_plan

แผนที่ประทับเวลาและสถานะ ส่งกลับแผนที่วันที่และสถานะที่วางแผนไว้ ซึ่งเป็นค่าเดียวกับที่มีใน current_status

ทางภูมิศาสตร์

ค้นหาการกำหนดเป้าหมายตามประเทศ กลุ่มประเทศ เมือง รัฐ รหัสไปรษณีย์ และพื้นที่ทางภูมิศาสตร์อื่นๆ ที่ type=adgeolocation โดยคุณสามารถระบุพารามิเตอร์แบบระบุหรือไม่ก็ได้ด้วย type=adgeolocation หากต้องการค้นหารหัสประเทศของสหรัฐอเมริกา ให้ใช้โค้ดดังนี้

curl -G \
  -d 'location_types=["country"]' \
  -d 'type=adgeolocation' \
  -d 'q=un' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "key": "GB", 
      "name": "United Kingdom", 
      "type": "country", 
      "supports_city": false, 
      "supports_region": false
    }, 
    {
      "key": "AE", 
      "name": "United Arab Emirates", 
      "type": "country", 
      "supports_city": false, 
      "supports_region": false
    }, 
    {
      "key": "UM", 
      "name": "United States Minor Outlying Islands", 
      "type": "country", 
      "supports_city": false, 
      "supports_region": false
    }
  ]
}

key คือหมายเลขตายตัวที่ไม่ซ้ำกันในแต่ละหมวดหมู่ เช่น ประเทศหรือกลุ่มประเทศ ช่องอื่นๆ รวมถึง name อาจมีการเปลี่ยนแปลง ให้ใช้ key เพื่อกำหนด ข้อมูลจำเพาะของการกำหนดเป้าหมาย

ในการตอบกลับ:

  • หาก supports_region เป็น true แปลว่าประเทศนี้มีรหัสภูมิภาค
  • หาก supports_city เป็น true แปลว่าประเทศนี้มีรหัสเมือง
ชื่อ คำอธิบาย

location_types

ประเภท: อาร์เรย์

country, country_group, region, city, zip, geo_market หรือ electoral_district ทั้งนี้รายการสุดท้ายมีเฉพาะในสหรัฐฯ เท่านั้น
location_types เป็นที่นิยมใช้กันมากกว่า type=adcountry และอื่นๆ

region_id

ประเภท: จำนวนเต็ม

ภูมิภาคที่ต้องการค้นหา

country_code

ประเภท: สตริง

ประเทศที่ต้องการค้นหา: country_code=US

ประเทศ

ทุกประเทศที่คุณสามารถกำหนดเป้าหมายได้ ต้องมีรหัสประเทศ พารามิเตอร์แบบระบุหรือไม่ก็ได้สำหรับ type=adgeolocation&location_types=['country']:

ชื่อ คำอธิบาย

q

ประเภท: สตริง

สตริงในการกำหนดค่าโดยอัตโนมัติ หากต้องการแสดงรายชื่อประเทศทั้งหมดที่มี location_types=['country'] ให้เว้น q= ว่างไว้และตั้งขีดจำกัดให้สูง limit=1000

match_country_code

ประเภท: บูลีน

มีค่าเริ่มต้นเป็น false

ค้นหาประเทศตามรหัสประเทศ ค้นหาประเทศตาม country_code เทียบกับ name

กลุ่มประเทศ

กลุ่มประเทศทั้งหมดมีรหัสไว้สำหรับการค้นหาและรับข้อมูลรายชื่อประเทศ สำหรับกลุ่มประเทศทั้งหมดที่ชื่อ mercosur:

curl -G \
  -d 'location_types=["country_group"]' \
  -d 'type=adgeolocation' \
  -d 'q=mercosur' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "key": "mercosur",
      "name": "Mercosur",
      "type": "country_group",
      "country_codes": [
        "BR",
        "AR",
        "UY",
        "PY",
        "VE"
      ],
      "is_worldwide": false,
      "supports_region": true,
      "supports_city": true
    }
  ]
}

หาก is_worldwide เป็น true แปลว่าเป็นกลุ่มประเทศจากทั่วโลก หาก supports_region เป็น true แปลว่ากลุ่มประเทศดังกล่าวมีรหัสภูมิภาค หาก supports_city เป็น true แปลว่ากลุ่มดังกล่าวมีรหัสเมือง

ภูมิภาค

วิธีค้นหาภูมิภาคทั้งหมดที่ขึ้นต้นด้วยรหัส al:

curl -G \
  -d 'location_types=["region"]' \
  -d 'type=adgeolocation' \
  -d 'q=al' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "key": "3843",
      "name": "Alabama",
      "type": "region",
      "country_code": "US",
      "country_name": "United States",
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "3844",
      "name": "Alaska",
      "type": "region",
      "country_code": "US",
      "country_name": "United States",
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "527",
      "name": "Alberta",
      "type": "region",
      "country_code": "CA",
      "country_name": "Canada",
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "1089",
      "name": "Alsace",
      "type": "region",
      "country_code": "FR",
      "country_name": "France",
      "supports_region": true,
      "supports_city": true
    }
  ]
}

ตัวเลือกสำหรับ type=adgeolocation&location_types=['region']:

ชื่อ คำอธิบาย

q

ประเภท: สตริง

สตริงในการกำหนดค่าโดยอัตโนมัติ หากต้องการรับข้อมูลประเทศทั้งหมดที่มี location_types=['region']: ไม่ต้องระบุพารามิเตอร์, q= และตั้งขีดจำกัดให้สูง limit=1000

หาก supports_region เป็น true แปลว่าคุณสามารถกำหนดเป้าหมายภูมิภาคนี้ได้ หาก supports_city เป็น true แปลว่าภูมิภาคนี้มีรหัสเมือง

เมือง

ตั้งแต่เดือนมีนาคม 2019 เราได้จัดประเภทเมืองต่างๆ ใหม่ให้เป็นบทบาทอื่นๆ แต่คุณยังสามารถใช้ city ต่อไปได้ โดยผลการค้นหาจะแสดงผลลัพธ์ที่ก่อนหน้านี้เคยเป็นเมือง

วิธีค้นหารหัสสำหรับเมืองทั้งหมดที่ขึ้นต้นด้วย Manhattan:

curl -G \
     -d 'location_types=["city"]' \
     -d 'type=adgeolocation' \
     -d 'q=Manhattan' \
     -d 'access_token=ACCESS_TOKEN' \
     https://graph.facebook.com/VERSION/search

การตอบกลับ

{
  "data": [
    {
      "key": "2447439",
      "name": "Manhattan",
      "type": "city",
      "country_code": "US",
      "country_name": "United States",
      "region": "Kansas",
      "region_id": 3859,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "2439596",
      "name": "Manhattan",
      "type": "city",
      "country_code": "US",
      "country_name": "United States",
      "region": "Illinois",
      "region_id": 3856,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "2479541",
      "name": "Manhattan",
      "type": "city",
      "country_code": "US",
      "country_name": "United States",
      "region": "Montana",
      "region_id": 3869,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "2428908",
      "name": "Manhattan",
      "type": "city",
      "country_code": "US",
      "country_name": "United States",
      "region": "Florida",
      "region_id": 3852,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "2703980",
      "name": "Manhattan",
      "type": "subcity",
      "country_code": "US",
      "country_name": "United States",
      "region": "New York",
      "region_id": 3875,
      "supports_region": true,
      "supports_city": true,
      "geo_hierarchy_level": "SUBCITY",
      "geo_hierarchy_name": "BOROUGH"
    },
   ...

หาก supports_region เป็น true แปลว่าสามารถกำหนดเป้าหมายภูมิภาคดังกล่าวของเมืองนี้ได้ หาก supports_city เป็น true แปลว่าสามารถกำหนดเป้าหมายเมืองนี้ได้

พื้นที่ทางภูมิศาสตร์

เรามีพื้นที่ทางภูมิศาสตร์อื่นๆ ที่คุณสามารถใช้กำหนดเป้าหมายได้ เรายังไม่ได้กำหนดบางพื้นที่ ดังที่ระบุไว้ด้านล่าง

พื้นที่คำอธิบาย

LARGE_GEO_AREA

รู้จักกันโดยทั่วไปว่าเป็นเขตหรือเขตการปกครองที่ครอบคลุมพื้นที่อย่างน้อยหลายร้อยตารางกิโลเมตร ตัวอย่าง: Akkar ใน Lebanon

MEDIUM_GEO_AREA

รู้จักกันโดยทั่วไปว่าเป็นประเทศ ซึ่งครอบคลุมมากกว่า 1 เมือง ตัวอย่าง: เขตปกครอง Henrico ในรัฐ Virginia ใน United States

SMALL_GEO_AREA

รู้จักกันโดยทั่วไปว่าเป็นเขตที่พักอาศัยใกล้เมืองหรือเทศบาล ตัวอย่าง: El Rosario ที่อยู่ใกล้กับมาร์เบยาใน Spain

SUBCITY

เช่น เขตเทศบาล ตัวอย่าง: Brooklyn ใน New York

NEIGHBORHOOD

พื้นที่ในเมือง ตัวอย่าง: Barton Estates, Irving ใน Texas

SUBNEIGHBORHOOD

ยังไม่พร้อมใช้งาน

METRO_AREA

พื้นที่ที่มีประชากรอาศัยอยู่หนาแน่นรอบเมืองที่ใหญ่กว่า ยังไม่พร้อมใช้งาน

ลำดับชั้นของพื้นที่ทางภูมิศาสตร์มีดังต่อไปนี้ โดยเรียงลำดับตั้งแต่ใหญ่ที่สุดไปจนเล็กที่สุด

  • REGION
  • LARGE_GEO_AREA
  • MEDIUM_GEO_AREA
  • SMALL_GEO_AREA
  • METRO_AREA
  • CITY
  • SUBCITY
  • NEIGHBORHOOD
  • SUBNEIGHBORHOOD

รหัสไปรษณีย์

คุณสามารถค้นหารหัสไปรษณีย์เพื่อกำหนดเป้าหมายบน Facebook ได้ด้วยเช่น ในการค้นหารหัสไปรษณีย์ เราขอแนะนำให้ใช้ adgeolocation พร้อมด้วย location_types=['zip'] ไปที่ศูนย์ช่วยเหลือของ Meta เพื่อดูรายชื่อประเทศพร้อมรหัสไปรษณีย์ที่รองรับ

ค้นหารหัสไปรษณีย์ที่ขึ้นต้นด้วย 9:

curl -G \
  -d 'location_types=["zip"]' \
  -d 'type=adgeolocation' \
  -d 'q=9' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/LATEST-API-VERSION/search

การตอบกลับ

{
  "data": [
    {
      "key": "US:90028",
      "name": "90028",
      "type": "zip",
      "country_code": "US",
      "country_name": "United States",
      "region": "California",
      "region_id": 3847,
      "primary_city": "Los Angeles",
      "primary_city_id": 2420379,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "US:94110",
      "name": "94110",
      "type": "zip",
      "country_code": "US",
      "country_name": "United States",
      "region": "California",
      "region_id": 3847,
      "primary_city": "San Francisco",
      "primary_city_id": 2421836,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "US:94501",
      "name": "94501",
      "type": "zip",
      "country_code": "US",
      "country_name": "United States",
      "region": "California",
      "region_id": 3847,
      "primary_city": "Alameda",
      "primary_city_id": 2417628,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "US:95190",
      "name": "95190",
      "type": "zip",
      "country_code": "US",
      "country_name": "United States",
      "region": "California",
      "region_id": 3847,
      "primary_city": "San Jose",
      "primary_city_id": 2421846,
      "supports_region": true,
      "supports_city": true
    }
  ]
}

รูปแบบภาษา

รูปแบบภาษาที่กำหนดเป้าหมายได้ตามรหัสรูปแบบภาษา วิธีค้นหารูปแบบภาษาทั้งหมดที่ขึ้นต้นด้วย en:

curl -G \
  -d 'type=adlocale' \
  -d 'q=en' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
{
      "data": [
        {
          "key": 51, 
          "name": "English (Upside Down)"
        }, 
        {
          "key": 6, 
          "name": "English (US)"
        }, 
        {
          "key": 24, 
          "name": "English (UK)"
        }
      ]
    }
}
ชื่อ คำอธิบาย

q

ประเภท: สตริง

สตริงที่ต้องการกำหนดค่าโดยอัตโนมัติ หากต้องการรับข้อมูลรูปแบบภาษาทั้งหมด ให้เว้น q= ว่างไว้และตั้งขีดจำกัดให้สูง limit=1000

รหัส DMA

หากต้องการรับรหัสเหล่านี้ ให้ระบุ type=adgeolocation และ location_types=['geo_market'] ในการสืบค้นของคุณ วิธีค้นหารหัส DMA ที่ขึ้นต้นด้วย "New":

curl -G \
  -d 'location_types=["geo_market"]' \
  -d 'type=adgeolocation' \
  -d 'q=New' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

ผลลัพธ์:

{
  "data": [
    {
      "key": "DMA:622",
      "name": "New Orleans",
      "type": "geo_market",
      "country_code": "US",
      "country_name": "United States",
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "DMA:501",
      "name": "New York",
      "type": "geo_market",
      "country_code": "US",
      "country_name": "United States",
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "DMA:533",
      "name": "Hartford &amp; New Haven",
      "type": "geo_market",
      "country_code": "US",
      "country_name": "United States",
      "supports_region": true,
      "supports_city": true
    },
    {
....
    }
  ]
}

เขตเลือกตั้ง

หากต้องการค้นหาเขตเลือกตั้งที่จะกำหนดเป้าหมาย ให้ระบุ type=adgeolocation และ location_types=['electoral_district'] วิธีค้นหาเขตเลือกตั้งในแคลิฟอร์เนีย:

curl -G \
  -d 'location_types=["electoral_district"]' \
  -d 'type=adgeolocation' \
  -d 'q=California' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "key": "US:CA14",
      "name": "California's 14th District",
      "type": "electoral_district",
      "country_code": "US",
      "country_name": "United States",
      "region": "California",
      "region_id": 3847,
      "supports_region": true,
      "supports_city": true
    },
    {
      "key": "US:CA02",
      "name": "California's 2nd District",
      "type": "electoral_district",
      "country_code": "US",
      "country_name": "United States",
      "region": "California",
      "region_id": 3847,
      "supports_region": true,
      "supports_city": true
    },
 ...
}

เมตาดาต้าของตำแหน่งที่ตั้งทางภูมิศาสตร์

คุณสามารถใช้พารามิเตอร์แบบระบุหรือไม่ก็ได้เพิ่มเติมได้โดยใช้ type=adgeolocationmeta

curl -G \
  -d 'cities=[2418779]' \
  -d 'zips=["US:90210"]' \
  -d 'countries=["US","JP"]' \
  -d 'regions=[10]' \
  -d 'type=adgeolocationmeta' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับจะเป็นอ็อบเจ็กต์ JSON ที่มีเมตาดาต้าสำหรับตำแหน่งที่ตั้งทางภูมิศาสตร์ที่ระบุ

{
  "data": {
    "countries": {
      "US": {
        "key": "US", 
        "type": "country", 
        "name": "United States", 
        "supports_city": true, 
        "supports_region": true
      }, 
      "JP": {
        "key": "JP", 
        "type": "country", 
        "name": "Japan", 
        "supports_city": true, 
        "supports_region": true
      }
    }, 
    "regions": {
      "10": {
        "key": "10", 
        "type": "region", 
        "name": "Dubai", 
        "country_code": "AE", 
        "supports_city": true, 
        "supports_region": false
      }
    }, 
    "cities": {
      "2418779": {
        "key": "2418779", 
        "type": "city", 
        "name": "Danville", 
        "region_id": 3847, 
        "region": "California", 
        "country_code": "US", 
        "supports_city": true, 
        "supports_region": true
      }
    }, 
    "zips": {
      "US:90210": {
        "key": "US:90210", 
        "type": "zip", 
        "name": "90210", 
        "primary_city": "Beverly Hills", 
        "region_id": 3847, 
        "region": "California", 
        "country_code": "US", 
        "supports_city": true, 
        "supports_region": true
      }
    }
  }
}

ตัวเลือก

ชื่อ คำอธิบาย

countries

ประเภท: สตริง

อาร์เรย์ของรหัสประเทศ

regions

ประเภท: จำนวนเต็ม

อาร์เรย์ของรหัสภูมิภาค

country_groups

ประเภท: สตริง

อาร์เรย์ของรหัสกลุ่มประเทศ

cities

ประเภท: จำนวนเต็ม

อาร์เรย์ของคีย์เมือง

zips

ประเภท: สตริง

อาร์เรย์ของรหัสไปรษณีย์แบบเต็ม ตัวอย่างเช่น US:92103

คำแนะนำเกี่ยวกับรัศมี

หากต้องการกำหนดเป้าหมายรอบๆ ตำแหน่งที่ตั้งที่เจาะจง ให้ค้นหารัศมีที่แนะนำและเข้าถึงผู้คนจำนวนมากพอด้วย suggested_radius:

curl -G \
  -d 'latitude=37.449478' \
  -d 'longitude=-122.173016' \
  -d 'type=adradiussuggestion' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับจะเป็นอ็อบเจ็กต์ JSON ที่มี suggested_radius และ distance_unit

{
  "data": [
    {
      "suggested_radius": 10,
      "distance_unit": "mile"
    }
  ]
}

ตัวอย่างการดึงข้อมูล suggested_radius ที่มี distance_unit ตามที่ระบุ:

curl -G \
  -d 'latitude=37.449478' \
  -d 'longitude=-122.173016' \
  -d 'type=adradiussuggestion' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search
{
  "data": [
    {
      "suggested_radius": 16,
      "distance_unit": "kilometer"
    }
  ]
}

ใช้พารามิเตอร์ต่อไปนี้:

ชื่อ คำอธิบาย

latitude

ประเภท: ทศนิยม

จำเป็นต้องระบุ

ละติจูดของตำแหน่งที่ตั้ง

longitude

ประเภท: ทศนิยม

จำเป็นต้องระบุ

ลองจิจูดของตำแหน่งที่ตั้ง

distance_unit

ประเภท: สตริง

ระบุหรือไม่ก็ได้

หน่วยวัดเป็น mile หรือ kilometer

โปรดดูโฆษณาเพื่อการรับรู้ในพื้นที่เพื่อใช้ร่วมกับคำแนะนำ

ความสนใจ

ส่งคำขอ GET ไปที่ตำแหน่งข้อมูล /search และตั้งค่า type เป็น adinterest และ q ตามความสนใจเฉพาะที่ต้องการค้นหา:

curl -G \
  -d 'type=adinterest' \
  -d 'q=baseball' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับจะส่งคืนช่องต่อไปนี้:

ชื่อ คำอธิบาย

id

จำนวนเต็ม

Facebook ID ของการกำหนดเป้าหมายตามความสนใจ

locale

string

หากมี ให้เรียกดูเนื้อหาในรูปแบบภาษาที่เฉพาะเจาะจงในรูปแบบ language_TERRITORY ค่าเริ่มต้นเป็น en_US

name

สตริง

ชื่อของความสนใจ

path

array of strings

รวมหมวดหมู่และหมวดหมู่หลักสำหรับการกำหนดเป้าหมาย

คำแนะนำเกี่ยวกับความสนใจ

ส่งคำขอ GET ไปยังตำแหน่งข้อมูล /search และตั้งค่า type เป็น adinterestsuggestion เพื่อรับรายการความสนใจที่แนะนำซึ่งเกี่ยวข้องกับคุณ

ตัวอย่างการสืบค้น

curl -G \
  -d 'interest_list=["Basketball"]' \
  -d 'type=adinterestsuggestion' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/<API_VERSION>/search

ตัวอย่างการตอบกลับ

{
  "data": [
    {
      "id": "6003598240487",
      "name": "la biblia",
      "audience_size": 7419780,
      "path": [
  ],
      "description": null
   },
   {
      "id": "6003022269556",
      "name": "Rugby football",
      "audience_size": 13214830,
      "path": [
  ],
      "description": null
   },
   {
      "id": "6003146664949",
      "name": "Netball",
      "audience_size": 4333770,
      "path": [
  ],
"description": null
   },
   {
      "id": "6003013291881",
      "name": "Kaizer Chiefs F.C.",
      "audience_size": 1812850,
      "path": [
  ],
      "description": null
  },
  ....
  {
      "id": "6003400886535",
      "name": "espn sportscenter",
      "audience_size": 222960,
      "path": [
  ],
     "description": null
  },
  {
     "id": "6002925969459",
     "name": "watching movies",
     "audience_size": 4630950,
     "path": [
  ],
     "description": null
  },
  {
     "id": "6003214125247",
     "name": "lakers",
     "audience_size": 340360,
     "path": [
  ],
     "description": null
  }

ตัวเลือกประกอบด้วย

ชื่อ คำอธิบาย

interest_list

ประเภท: อาร์เรย์ของสตริง

จำเป็นต้องระบุ

รายการคำสำคัญที่คุณต้องการคำแนะนำ คำนึงถึงอักษรตัวพิมพ์ใหญ่และตัวพิมพ์เล็ก

ข้อจำกัด

  • ในการค้นหาครั้งหนึ่งๆ ระบบอาจไม่แสดงความสนใจที่มีอยู่บางรายการ
  • ความสนใจอาจได้รับการเปลี่ยนชื่อเมื่อใดก็ได้ และการตรวจสอบยืนยันด้วยชื่ออาจล้มเหลวเมื่อมีการเปลี่ยนชื่อดังกล่าว ดังนั้นเราแนะนำให้ตรวจสอบยืนยันความสนใจตาม interest_fbid_list มากกว่าจะพิจารณาจากชื่อ ตรวจสอบว่าคำสำคัญถูกต้องหรือไม่โดยการสืบค้นด้วย type=adinterestvalid และความสนใจที่จะตรวจสอบยืนยัน:
curl -G \
  -d 'interest_list=["Japan","nonexistantkeyword"]' \
  -d 'type=adinterestvalid' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "name": "Japan",
      "valid": true,
      "id": 6003700426513,
      "audience_size": 68310258
    },
    {
      "name": "nonexistantkeyword",
      "valid": false
    }
  ]
}

ตัวเลือก

ชื่อ คำอธิบาย

interest_list

ประเภท: อาร์เรย์ของสตริง

ต้องระบุ หากไม่มี interest_fbid_list

รายการคำต่างๆ ที่จะตรวจสอบความถูกต้อง คำนึงถึงอักษรตัวพิมพ์ใหญ่และตัวพิมพ์เล็ก

interest_fbid_list

ประเภท: อาร์เรย์ของ ID

ต้องระบุ หากไม่มี interest_list

รายการของ ID ที่จะตรวจสอบความถูกต้อง

ความสนใจ

หากต้องการดูความสนใจที่อาจใช้ในการกำหนดเป้าหมายได้ ให้ส่งคำขอ GET ไปที่ตำแหน่งข้อมูล /search โดยตั้งค่า type เป็น adTargetingCategory และตั้งค่า class เป็น interests

curl -G \
  -d 'type=adTargetingCategory' \
  -d 'class=interests' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

ข้อจำกัด

  • ในการค้นหาครั้งหนึ่งๆ ระบบอาจไม่แสดงความสนใจที่มีอยู่บางรายการ

รูปแบบพฤติกรรม

กำหนดเป้าหมายจากข้อมูลการดำเนินการของผู้ใช้ หรือรูปแบบพฤติกรรมการซื้อในอดีต เรียกดูตัวเลือกการกำหนดเป้าหมายตามรูปแบบพฤติกรรมที่เป็นไปได้ทั้งหมดด้วย type=adTargetingCategory&class=behaviors

curl -G \
  -d 'type=adTargetingCategory' \
  -d 'class=behaviors' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับจะมีข้อมูลดังนี้:

ชื่อ คำอธิบาย

name

ประเภท: สตริง

ชื่อของรูปแบบพฤติกรรมที่กำหนดเป้าหมาย

id

ประเภท: จำนวนเต็ม

Facebook ID ของการกำหนดเป้าหมายตามพฤติกรรม

audience_size_lower_bound

จำนวนเต็ม

ขนาดกลุ่มเป้าหมายที่เป็นขอบเขตล่างสุดโดยประมาณ

audience_size_upper_bound

จำนวนเต็ม

ขนาดกลุ่มเป้าหมายที่เป็นขอบเขตบนสุดโดยประมาณ

path

ประเภท: อาร์เรย์ของสตริง

หมวดหมู่และหมวดหมู่หลักสำหรับการกำหนดเป้าหมายนี้

description

ประเภท: สตริง

อธิบายกลุ่มเป้าหมาย

type

ประเภท: สตริง

คลาสหมวดหมู่การกำหนดเป้าหมาย

ข้อมูลทางประชากรศาสตร์

ข้อมูลในส่วนนี้ประกอบด้วยสถานที่ทำงาน การศึกษา ประเภทตำแหน่งงาน และประเภทสถานะความสัมพันธ์ นอกจากนี้คุณยังสามารถกำหนดเป้าหมายตามช่วงระยะเวลาล่าสุดนับจากที่เกิดเหตุการณ์ในชีวิตได้ด้วย ได้แก่ 3 เดือน, 6 เดือน และ 1 ปี คุณสามารถอ้างอิงโรงเรียนที่ต้องการกำหนดเป้าหมายได้ด้วย ID และชื่อ

วิธีค้นหาโรงเรียนทั้งหมดที่ขึ้นต้นด้วย ha:

curl -G \
  -d 'type=adeducationschool' \
  -d 'q=ha' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

 {
  "data": [
    {
      "name": "Harvard University", 
      "id": 105930651606,
      "coverage": 8395398,
      "subtext": "Cambridge, Massachusetts"
    }, 
    {
      "name": "Hajvery University", 
      "id": 148971135122588,
      "coverage": 124162
    }, 
    {
      "name": "Harvard-Westlake School", 
      "id": 107799365910274,
      "coverage": 14106
    }
  ]
}

วิชาเอกที่ศึกษา

กำหนดเป้าหมายวิชาเอกตาม ID และชื่อ วิธีค้นหาวิชาเอกทั้งหมดที่ขึ้นต้นด้วย ph:

curl -G \
  -d 'type=adeducationmajor' \
  -d 'q=ph' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "name": "Photography", 
      "id": 108170975877442,
      "coverage": 613618
    }, 
    {
      "name": "Physics", 
      "id": 109279729089828,
      "coverage": 942491
    }, 
    {
      "name": "Philosophy", 
      "id": 108026662559095,
      "coverage": 701271
    }
  ]
}

นายจ้างที่ทำงาน

นายจ้างที่สามารถกำหนดเป้าหมายได้สำหรับอ้างอิงเรียงตาม ID และชื่อ วิธีค้นหานายจ้างที่ทำงานทั้งหมดที่ขึ้นต้นด้วย mic:

curl -G \
  -d 'type=adworkemployer' \
  -d 'q=mic' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
  "data": [
    {
      "name": "Western Michigan University", 
      "id": 10022826163,
      "coverage": 24366
    }, 
    {
      "name": "University of Michigan", 
      "id": 21105780752,
      "coverage": 17357
    }, 
    {
      "name": "Michigan State University - SPARTANS", 
      "id": 8891783019,
      "coverage": 65853
    }
  ]
}

ตำแหน่งงาน

ตำแหน่งงานระบุเองที่กำหนดเป้าหมายได้ทั้งหมดจะมี ID และชื่อ วิธีรับตำแหน่งงานทั้งหมดที่มี Business Analyst:

curl -G \
  -d 'type=adworkposition' \
  -d 'q=Business Analyst' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v<API_VERSION>/search

การตอบกลับ

{
   "data": [
    {
      "name": "Business Analyst", 
      "id": 105763692790962,
      "coverage": 282124
    }, 
    {
      "name": "Financial Analyst", 
      "id": 112930925387573,
      "coverage": 212889
    }
  ]
}

การตอบกลับจะมีช่องเหล่านี้:

ชื่อ คำอธิบาย

name

ประเภท: สตริง

ชื่อของการกำหนดเป้าหมายทางประชากรศาสตร์

id

ประเภท: จำนวนเต็ม

Facebook ID ของการกำหนดเป้าหมายทางประชากรศาสตร์

coverage

ประเภท: int

ขนาดกลุ่มเป้าหมายโดยประมาณ

subtext

ประเภท: สตริง

คำอธิบายของกลุ่มเป้าหมาย


พารามิเตอร์ต่อไปนี้เป็นพารามิเตอร์ทั่วไปสำหรับ API นี้ ในส่วนของพารามิเตอร์อินพุตเฉพาะประเภท โปรดดูรายละเอียดด้านล่าง

ชื่อพารามิเตอร์ คำอธิบาย

q

ต้องระบุสำหรับประเภทการค้นหาส่วนใหญ่

สตริงในการกำหนดค่าโดยอัตโนมัติ

type

จำเป็นต้องระบุ

ประเภทของข้อมูลที่กำหนดค่าโดยอัตโนมัติที่ต้องการเรียกใช้ ดูด้านล่าง

list

ระบุหรือไม่ก็ได้

เรียกดู Facebook ID ทั่วโลกที่ต้องการ ไม่ใช่รหัส FIPS รองรับ adzipcode

เมื่อนำมาใช้ ค่าจะต้องเท่ากับ GLOBAL

limit

ระบุหรือไม่ก็ได้

ผลลัพธ์สูงสุดที่จะส่งกลับ โดยมีค่าเริ่มต้นเป็น 8

จากหมวดหมู่ของข้อมูลที่กำหนดค่าโดยอัตโนมัติ ให้ระบุ type ที่เหมาะสม และให้ระบุ type=adlocale เพื่อเรียกดูรูปแบบภาษา หมวดหมู่ที่ถูกต้องคือ:

ค่าสำหรับพารามิเตอร์ `type` คำอธิบาย

adeducationschool

กำหนดค่าการกำหนดเป้าหมายมหาวิทยาลัยโดยอัตโนมัติ

adeducationmajor

กำหนดค่าการกำหนดเป้าหมายวิชาเอกของมหาวิทยาลัยโดยอัตโนมัติ

adgeolocation

กำหนดค่าประเทศ เมือง รัฐ และรหัสไปรษณีย์โดยอัตโนมัติ

adgeolocation.adcountry

กำหนดค่าประเทศโดยอัตโนมัติ

adgeolocation.adzipcode

กำหนดค่ารหัสไปรษณีย์โดยอัตโนมัติ

adgeolocation.adgeolocationmeta

เมตาดาต้าเพิ่มเติมสำหรับตำแหน่งที่ตั้งทางภูมิศาสตร์

adgeolocation.adradiussuggestion

ส่งกลับรัศมีขอบเขตที่แนะนำรอบๆ ตำแหน่งที่ตั้ง

adinterest

กำหนดค่าการกำหนดเป้าหมายรูปแบบภาษาโดยอัตโนมัติ

adinterest.adinterestsuggestion

คำแนะนำจากข้อมูลการกำหนดเป้าหมายตามความสนใจ

adinterest.adinterestvalid

ตรวจสอบสตริงว่าเป็นตัวเลือกการกำหนดเป้าหมายตามความสนใจที่ถูกต้อง

adlocale

กำหนดค่าการกำหนดเป้าหมายรูปแบบภาษาโดยอัตโนมัติ

adTargetingCategory

ระบบจะไม่ตอบสนองต่อพารามิเตอร์ q ดูตัวเลือกการกำหนดเป้าหมายที่เป็นไปได้ทั้งหมดสำหรับคลาสที่มีพารามิเตอร์ class
ค่าที่เป็นไปได้ของ class: interests, behaviors, demographics, life_events, industries, income, family_statuses, user_device, user_os

adworkemployer

กำหนดค่าสำหรับนายจ้างที่ทำงานโดยอัตโนมัติ

adworkposition

กำหนดค่าสำหรับตำแหน่งงานโดยอัตโนมัติ

การเลือกดูข้อมูลทางประชากรศาสตร์

เรียกดูตัวเลือกการกำหนดเป้าหมายทางประชากรศาสตร์ที่เป็นไปได้ทั้งหมดด้วย type=adTargetingCategory และ class

ชื่อ คำอธิบาย

class

ประเภท: สตริง

ระบุ 1 รายการ: life_events, industries, income, family_statuses, user_device การระบุ demographics จะเป็นการเรียกดูข้อมูลทั้งหมด


ตัวเลือกการกำหนดเป้าหมายทางประชากรศาสตร์ไม่สามารถใช้ได้ในบางประเทศ Facebook อาจส่งกลับผลลัพธ์ที่แตกต่างกัน รวมไปถึงผลลัพธ์เปล่า ทั้งนี้ขึ้นอยู่กับการตั้งค่าประเทศที่อยู่ของผู้ใช้ที่มีโทเค็นการเข้าถึงที่กำลังใช้งานเพื่อทำการเรียก API นี้

การตอบกลับจะมีช่องเหล่านี้:

ชื่อ คำอธิบาย

name

ประเภท: สตริง

ชื่อของการกำหนดเป้าหมายทางประชากรศาสตร์

id

ประเภท: จำนวนเต็ม

Facebook ID ของการกำหนดเป้าหมายทางประชากรศาสตร์

audience_size_lower_bound

จำนวนเต็ม

ขนาดกลุ่มเป้าหมายที่เป็นขอบเขตล่างสุดโดยประมาณ

audience_size_upper_bound

จำนวนเต็ม

ขนาดกลุ่มเป้าหมายที่เป็นขอบเขตบนสุดโดยประมาณ

description

ประเภท: สตริง

คำอธิบายของกลุ่มเป้าหมาย

type

ประเภท: สตริง

ประเภทของข้อมูลทางประชากรศาสตร์ หากคุณเรียกดูข้อมูลทางประชากรศาสตร์ทั้งหมด จะเป็นประโยชน์

path

ประเภท: อาร์เรย์ของสตริง

รวมหมวดหมู่และหมวดหมู่หลักที่อยู่ในการกำหนดเป้าหมาย