# Get ASO keyword gap

Compare stored keyword positions between two apps.

## Contract status

Preview contract: these routes and tools are implemented in the shared contract, but the public host, customer API access and OAuth flow have not been deployment verified.

## Endpoint: GET /v1/aso/apps/{appId}/gap/{rivalStoreId}

- Method: `GET`
- Path: `/v1/aso/apps/{appId}/gap/{rivalStoreId}`
- Authentication: Bearer API credential or OAuth access token
- Required scope: `context:read`
- MCP tool: `get_aso_keyword_gap`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `appId` | path | uuid | yes | Tracked ASO app id. |
| `rivalStoreId` | path | numeric string | yes | Rival Apple App Store identifier. |

## Known errors

- 400 invalid_request for an invalid filter, identity or limit.
- 401 authentication_required for a missing or invalid credential.
- 402 subscription_required when access is not entitled.
- 403 authorization_required for a missing scope or unavailable preview access.
- 404 not_found when the record is outside the accessible catalogue.
- 429 rate_limited; honor Retry-After when present.

## Request

Compares stored positions for the subject app and a rival store id. This GET never calls Apple.

```
curl --get 'https://api.peekpanda.com/v1/aso/apps/11111111-1111-4111-8111-111111111111/gap/0000000001' \
  --header "Authorization: Bearer $PEEKPANDA_TOKEN" \
  --header 'x-genviral-tenancy: personal'
```

## Response

Illustrative asoKeywordGapSchema. Only-rival, only-subject and shared rows are stored observed positions, not estimates.

```
{
  "subjectStoreId": "0000000000",
  "rivalStoreId": "0000000001",
  "rivalName": "Rival Tracker",
  "onlyRival": [
    {
      "query": "calorie counter",
      "rivalPosition": 2
    }
  ],
  "onlySubject": [
    {
      "query": "calorie tracker",
      "subjectPosition": 4
    }
  ],
  "shared": [
    {
      "query": "food diary",
      "subjectPosition": 8,
      "rivalPosition": 3
    }
  ]
}

```

## Source

Apple public Search + Search hints. Difficulty from page-one rating counts Apple returns (page_one_median_rating_count: median page-one ratingCount, log10 scale, 1M ratings = 100). Demand is autocomplete order from apple_search_hints (rank + variant count), not volume and not Apple Ads popularity. Apple Ads Insights is not wired. Positions are observed_search_api_position from itunes.apple.com/search us/en_us.

## Refresh

This GET never calls Apple. Snapshots younger than 24 hours are served from storage; hints are reused for 7 days.
