# Store Regional Ad Analysis API Endpoint

## API Information

- **API Name**: Store Regional Ad Analysis API Endpoint
- **Request Method**: GET
- **API Address**: `/open-api/v1/data`
- **API Path**: `/v3/api/open/store/storeRegionAnalysis`
- **API Description**:
    - Get statistics on ad delivery count for a specified store across different platforms and regions
    - Query regional distribution data for the store on TikTok, Facebook, and Meta Ad Library platforms using store ID (id)
    - Pricing: `Free`

**Request Headers:**

- Content-Type: application/json
- Accept: application/json

## Request Parameters

### Request Structure

| Parameter | Type   | Description                        | Example                                      | Required | Default |
| --------- | ------ | ---------------------------------- | -------------------------------------------- | -------- | ------- |
| key       | string | External API request key           | "your_api_key_here"                          | Yes      |         |
| uri       | string | API path                           | "/v3/api/open/store/storeRegionAnalysis"     | Yes      |         |
| params    | object | API input parameters object        | See parameter list                           | Yes      |         |

### Request Body Parameters (params object)

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| id        | string | true     | Store ID is a 13-character string (e.g., `c2d5b2547218a`), corresponding to the `store_id` field in the store rank list API response. |


### Request Example

```bash
curl -X POST "https://www.pipispy.com/open-api/v1/data" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "key": "your_api_key_here",
    "uri": "/v3/api/open/store/storeRegionAnalysis",
    "params": {
      "id": "9407a696eb444"
    }
  }'
```

## Response Parameters

## Response Example

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "facebook_library_regions": [
      {
        "count": 58823,
        "region": "OTHER"
      },
      {
        "count": 20260,
        "region": "US"
      },
      {
        "count": 17957,
        "region": "JP"
      },
      {
        "count": 12519,
        "region": "AU"
      },
      {
        "count": 11868,
        "region": "GB"
      },
      {
        "count": 8193,
        "region": "KR"
      },
      {
        "count": 7279,
        "region": "FR"
      },
      {
        "count": 6105,
        "region": "DE"
      },
      {
        "count": 5345,
        "region": "CA"
      },
      {
        "count": 3886,
        "region": "AE"
      },
      {
        "count": 2539,
        "region": "SA"
      },
      {
        "count": 2075,
        "region": "TH"
      },
      {
        "count": 1509,
        "region": "MY"
      },
      {
        "count": 1171,
        "region": "MX"
      },
      {
        "count": 453,
        "region": "PL"
      },
      {
        "count": 398,
        "region": "NL"
      },
      {
        "count": 364,
        "region": "ID"
      },
      {
        "count": 211,
        "region": "BE"
      },
      {
        "count": 196,
        "region": "AT"
      },
      {
        "count": 196,
        "region": "SE"
      },
      {
        "count": 189,
        "region": "VN"
      },
      {
        "count": 107,
        "region": "IT"
      },
      {
        "count": 76,
        "region": "PH"
      },
      {
        "count": 69,
        "region": "FI"
      },
      {
        "count": 24,
        "region": "ES"
      },
      {
        "count": 23,
        "region": "IE"
      },
      {
        "count": 22,
        "region": "DK"
      }
    ],
    "facebook_regions": [
      {
        "count": 219,
        "region": "US"
      },
      {
        "count": 61,
        "region": "TH"
      },
      {
        "count": 56,
        "region": "DE"
      },
      {
        "count": 51,
        "region": "CA"
      },
      {
        "count": 49,
        "region": "VN"
      },
      {
        "count": 43,
        "region": "FR"
      },
      {
        "count": 38,
        "region": "GB"
      },
      {
        "count": 30,
        "region": "TW"
      },
      {
        "count": 21,
        "region": "ID"
      },
      {
        "count": 15,
        "region": "JP"
      },
      {
        "count": 12,
        "region": "MY"
      },
      {
        "count": 11,
        "region": "IT"
      },
      {
        "count": 9,
        "region": "HK"
      },
      {
        "count": 8,
        "region": "KR"
      },
      {
        "count": 7,
        "region": "AU"
      },
      {
        "count": 5,
        "region": "SG"
      },
      {
        "count": 5,
        "region": "PH"
      },
      {
        "count": 5,
        "region": "NL"
      },
      {
        "count": 3,
        "region": "ES"
      },
      {
        "count": 2,
        "region": "NZ"
      },
      {
        "count": 2,
        "region": "CH"
      },
      {
        "count": 2,
        "region": "CN"
      },
      {
        "count": 2,
        "region": "PL"
      },
      {
        "count": 1,
        "region": "FI"
      },
      {
        "count": 1,
        "region": "PT"
      },
      {
        "count": 1,
        "region": "GR"
      },
      {
        "count": 1,
        "region": "MX"
      },
      {
        "count": 1,
        "region": "LA"
      },
      {
        "count": 1,
        "region": "NG"
      },
      {
        "count": 1,
        "region": "TR"
      }
    ],
    "tiktok_region": [
      {
        "count": 10835,
        "region": "SG"
      },
      {
        "count": 7051,
        "region": "TH"
      },
      {
        "count": 6534,
        "region": "MY"
      },
      {
        "count": 4795,
        "region": "VN"
      },
      {
        "count": 4553,
        "region": "ID"
      },
      {
        "count": 2296,
        "region": "TW"
      },
      {
        "count": 1679,
        "region": "JP"
      },
      {
        "count": 1268,
        "region": "PH"
      },
      {
        "count": 825,
        "region": "CA"
      },
      {
        "count": 718,
        "region": "AU"
      },
      {
        "count": 569,
        "region": "KR"
      },
      {
        "count": 115,
        "region": "US"
      },
      {
        "count": 95,
        "region": "FR"
      },
      {
        "count": 92,
        "region": "NL"
      },
      {
        "count": 66,
        "region": "NO"
      },
      {
        "count": 42,
        "region": "SA"
      },
      {
        "count": 37,
        "region": "DE"
      },
      {
        "count": 36,
        "region": "AE"
      },
      {
        "count": 28,
        "region": "TR"
      },
      {
        "count": 24,
        "region": "GR"
      },
      {
        "count": 22,
        "region": "GB"
      },
      {
        "count": 16,
        "region": "DK"
      },
      {
        "count": 13,
        "region": "PT"
      },
      {
        "count": 13,
        "region": "SC"
      },
      {
        "count": 9,
        "region": "IT"
      },
      {
        "count": 8,
        "region": "MX"
      },
      {
        "count": 5,
        "region": "BE"
      },
      {
        "count": 5,
        "region": "BR"
      },
      {
        "count": 4,
        "region": "RO"
      },
      {
        "count": 3,
        "region": "AT"
      },
      {
        "count": 3,
        "region": "PL"
      },
      {
        "count": 2,
        "region": "ES"
      },
      {
        "count": 1,
        "region": "CZ"
      }
    ]
  },
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 0,
  "success": true,
  "fail": false
}
```

### Response Field Descriptions

| Field     | Type    | Description                       |
| --------- | ------- | --------------------------------- |
| code      | Integer | Response status code, 200 means success |
| message   | String  | Response message                  |
| data      | Object  | Response data                     |
| version   | String  | API version                       |
| timestamp | String  | Response timestamp                |
| sign      | String  | Response signature                |
| remaining_credits | Long    | Current remaining available credits after this request |
| consumed_credits  | Long    | Credits consumed by this request                       |
| success   | Boolean | Whether request was successful    |
| fail      | Boolean | Whether request failed            |

### Response Result Information Fields

| Field                    | Type          | Description                                         |
| ------------------------ | ------------- | --------------------------------------------------- |
| facebook_library_regions | Array[Region] | Meta Ad Library regional ad count statistics        |
| facebook_regions         | Array[Region] | Facebook platform regional ad count statistics      |
| tiktok_regions           | Array[Region] | TikTok platform regional ad count statistics        |

#### Region Object Structure

| Field  | Type   | Description                                        |
| ------ | ------ | -------------------------------------------------- |
| region | String | Region abbreviation code, such as US, GB, DE, IT   |
| count  | Long   | Corresponding ad count for this region             |


## Error Code Descriptions

| Error Code | Description           |
| ---------- | --------------------- |
| 200        | Success               |
| 400        | Request parameter error |
| 500        | Internal server error |