次の方法で共有


政治地区サービス

政治地区サービスは、政治的買い手が立法地区の境界に基づいて地域をターゲットにすることを可能にします。

この機能は、Microsoft Invest の既存の geo ターゲット モジュール内で使用でき、"政治区 (米国のみ)" と呼ばれています。 これにより、政治的買い手は次の政治的地域レベルをターゲットにできます。

  • 議会選挙区
  • 州上院地区
  • ステート ハウス ディストリクト

REST API

HTTP メソッド エンドポイント 説明
GET https://api.appnexus.com/political-district?id=DISTRICT_ID 既存の政治地区を表示します。
GET https://api.appnexus.com/political-district?search=SEARCH_TERM 政治地区を検索します ( district_iddistrict_namedistrict_type_idregion_idでのみ使用できます)。

JSON フィールド

全般

フィールド 型 (長さ) 説明
id int 政治地区の ID。
name string 政治地区の名前。
description string (省略可能)政治地区情報の詳細な説明。
postal_codes_count int 特定の地区に属する郵便番号の合計数。
postal_code_list_id int 政界に関連付けられている郵便番号一覧の ID。
postal_codes オブジェクトの配列 郵便番号一覧に含める郵便番号。
を参照してください。
必須のオン:POSTPUT
political_district オブジェクトの配列 一覧には、政治地区の完全な情報が詳細に記載されています。

postal_codes

"postal_codes":[
{"id": 1},
{"id": 2},
{"id": 3}
]

郵便番号オブジェクト

postal_codes オブジェクトには、次のフィールドが含まれています。

フィールド 型 (長さ) 説明
id int 郵便番号の ID。
code string 郵便番号。5 文字を含む英数字文字列を指定できます。
country_id int 国に関連付けられている ID。
active string 郵便番号の状態。郵便番号が active/inactiveされている場合に強調表示されます。
country_code string 都市が属する国の ISO Alpha-2 コード。 国コードの完全な一覧を取得するには、「 Country Service」を参照してください。
country_name string 市が属する国の名前。 国名の完全な一覧を取得するには、「 Country Service」を参照してください。

政治的地区のオブジェクト

political_district オブジェクトには、次のフィールドが含まれています。

フィールド 型 (長さ) 説明
id int 政治地区の ID。
district_name string 政治地区の名前。
district_type_id int 地区の種類。 使用可能な値は次のとおりです。
- Congress
- State House
- State Senate
region_id int region_idは、要求ヘッダーで渡されるregion_codeから API によって取得されます。
postal_code_list_id int 郵便番号一覧の ID。
created_on timestamp 読み取り専用。
政治地区リストの作成時刻。
last_modified timestamp 読み取り専用。
政治地区リストに最後に変更を加えた時刻。
country_id int 国に関連付けられている ID。
region_code string region_codeは、API がregion_idを検索するために使用する要求ヘッダーに存在します。

ID で既存の政治地区を表示する

curl -b cookies -c cookies -s "https://api.appnexus.com/political-district?id=145125" {
    "response": {
        "status": "OK",
        "start_element": 0,
        "num_elements": 100,
        "political-district": {
            "id": 145125,
            "name": "AR State House 012",
            "description": null,
            "postal_codes_count": 7,
            "postal_code_list_id": "145125",
            "postal_codes": [
                {
                    "id": 53520,
                    "code": "72714",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                },
                {
                    "id": 53521,
                    "code": "72715",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                },
                {
                    "id": 53527,
                    "code": "72722",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                },
                {
                    "id": 53535,
                    "code": "72736",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                },
                {
                    "id": 53538,
                    "code": "72739",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                },
                {
                    "id": 53544,
                    "code": "72747",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                },
                {
                    "id": 53563,
                    "code": "72768",
                    "country_id": 233,
                    "active": true,
                    "country_code": "US",
                    "country_name": "United States"
                }
            ],
            "political_district": [
                {
                    "id": 5199,
                    "district_name": "AR State House 012",
                    "district_type_id": 2,
                    "region_id": 3921,
                    "postal_code_list_id": 145125,
                    "created_on": "2022-04-11 16:10:08",
                    "last_modified": "2022-04-11 16:10:08",
                    "country_id": 233
                }
            ]
        },
        "count": 1,
        "dbg_info": {
            "warnings": [],
            "version": "1.1.61",
            "output_term": "political-district"
        }
    }
}

地区名で既存の政治地区を表示する

curl -b cookies -c cookies -s "https://api.appnexus.com/political-district?district_name=NY+State+House+001" {    
    "response": {
        "status": "OK",
        "start_element": 0,
        "num_elements": 100,
        "political-districts": [
            {
                "id": 144908,
                "name": "NY State House 001",
                "description": null,
                "postal_codes_count": 36,
                "postal_code_list_id": "144908",
                "postal_codes": [
                    {
                        "id": 8190,
                        "code": "11954",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8191,
                        "code": "11955",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8192,
                        "code": "11956",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8193,
                        "code": "11957",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8194,
                        "code": "11958",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8195,
                        "code": "11959",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8197,
                        "code": "11960",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8199,
                        "code": "11962",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8200,
                        "code": "11963",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8201,
                        "code": "11964",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8202,
                        "code": "11965",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8204,
                        "code": "11968",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8205,
                        "code": "11969",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8207,
                        "code": "11971",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8208,
                        "code": "11972",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8212,
                        "code": "11977",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 8213,
                        "code": "11978",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    }
                ],
                "political_district": [
                    {
                        "id": 4987,
                        "district_name": "NY State House 001",
                        "district_type_id": 2,
                        "region_id": 3950,
                        "postal_code_list_id": 144908,
                        "created_on": "2022-04-11 16:09:07",
                        "last_modified": "2022-04-11 16:09:07",
                        "country_id": 233
                    }
                ]
            }
        ],
        "count": 1,
        "dbg_info": {
            "warnings": [],
            "version": "1.1.61",
            "output_term": "political-districts"
        }
    }
}    

既存の政治地区を次の方法で表示する postal_code_list_id

$ curl -b cookies -X GET --url 'https://api.appnexus.com/political-district?postal_code_list_id=139897' {
    "response": {
        "status": "OK",
        "start_element": 0,
        "num_elements": 100,
        "political-districts": [
            {
                "id": 139897,
                "name": "AK Congress 01",
                "description": null,
                "postal_codes_count": 267,
                "postal_code_list_id": "139897",
                "postal_codes": [
                    {
                        "id": 70153,
                        "code": "99501",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                    },
                    {
                        "id": 70154,
                        "code": "99502",
                        "country_id": 233,
                        "active": true,
                        "country_code": "US",
                        "country_name": "United States"
                        },

Profile Service