openapi: 3.0.0
info:
  title: Apple Product API
  description: |
    Retrieve detailed information about apps on the Apple App Store. Get comprehensive app details including ratings, reviews, privacy information, pricing, version history, and related apps.

    **Cross-linking**: The `related_apps` returned by this API contains app IDs and URLs that can be used with the Apple Product API again to fetch details about related applications.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Apple Product Search
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          schema:
            type: string
            enum: ["apple_product"]
          description: Search engine to use
        - name: product_id
          in: query
          required: true
          schema:
            type: string
          description: The numeric Apple App Store product ID of the app
        - name: country
          in: query
          required: false
          schema:
            type: string
            default: "us"
            enum: ["al", "dz", "ao", "ai", "ag", "ar", "am", "au", "at", "az", "bs", "bh", "bb", "by", "be", "bz", "bj", "bm", "bt", "bo", "bw", "br", "vg", "bn", "bg", "bf", "kh", "ca", "cv", "ky", "cl", "td", "cn", "co", "cd", "cr", "hr", "cy", "cz", "dk", "dm", "do", "ec", "eg", "sv", "ee", "fj", "fi", "fr", "de", "gm", "gb", "gh", "gr", "gd", "gt", "gw", "gy", "hn", "hk", "hu", "is", "in", "id", "ie", "il", "it", "jm", "jp", "jo", "kz", "ke", "kw", "kg", "la", "lv", "lb", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my", "ml", "mt", "mr", "mu", "mx", "fm", "md", "mn", "ms", "mz", "na", "np", "nl", "nz", "ni", "ne", "ng", "no", "om", "pk", "pw", "pa", "pg", "py", "pe", "ph", "pl", "pt", "qa", "ro", "ru", "st", "sa", "sn", "sc", "sl", "sg", "sk", "si", "sb", "za", "kr", "es", "lk", "kn", "lc", "vc", "sr", "sz", "se", "ch", "tw", "tj", "tz", "th", "tt", "tn", "tr", "tm", "tc", "ug", "ua", "ae", "us", "uy", "uz", "ve", "vn", "ye", "zw"]
          description: Two-letter country code for the App Store region. Defaults to United States.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting for the limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        app_details:
          $ref: '#/components/schemas/AppDetails'
        information:
          $ref: '#/components/schemas/Information'
        reviews:
          type: array
          description: List of user reviews for the app
          items:
            $ref: '#/components/schemas/Review'
        supports:
          type: array
          description: Support resources and documentation links
          items:
            $ref: '#/components/schemas/Support'
        version_history:
          type: array
          description: Version release history with dates and notes
          items:
            $ref: '#/components/schemas/VersionHistory'
        app_privacy:
          $ref: '#/components/schemas/AppPrivacy'
        featured_in:
          type: array
          description: Editorial features and articles the app has been featured in
          items:
            $ref: '#/components/schemas/FeaturedIn'
        events:
          type: array
          description: Promotional events and special features for the app
          items:
            $ref: '#/components/schemas/Event'
        accessibility:
          type: array
          description: Accessibility features supported by the app
          items:
            $ref: '#/components/schemas/Accessibility'
        related_apps:
          $ref: '#/components/schemas/RelatedApps'
    SearchMetadata:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Apple App Store URL for this app
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          description: Search engine used
        product_id:
          type: string
          description: The app's product ID on the Apple App Store
        country:
          type: string
          description: Country code for the App Store region
    AppDetails:
      type: object
      description: Core information about the app
      properties:
        id:
          type: string
          description: The unique identifier of the app on the App Store
        bundle_id:
          type: string
          description: The app's bundle identifier (reverse domain notation)
        name:
          type: string
          description: Official name of the app
        snippet:
          type: string
          description: Short subtitle or tagline for the app
        description:
          type: string
          description: Full description of the app and its features
        logo:
          type: string
          description: URL of the app's icon/logo image
        screenshots:
          type: array
          description: Screenshots organized by device type
          items:
            $ref: '#/components/schemas/ScreenshotGroup'
        developer:
          $ref: '#/components/schemas/Developer'
        rating:
          type: number
          format: float
          description: Average user rating out of 5 stars
        reviews:
          type: integer
          description: Total number of user reviews
        reviews_histogram:
          $ref: '#/components/schemas/ReviewsHistogram'
    ScreenshotGroup:
      type: object
      description: Screenshots for a specific device type
      properties:
        device:
          type: string
          description: Device type (e.g., iPad, iPhone)
        screenshots:
          type: array
          description: Array of screenshot image URLs for this device
          items:
            type: string
    Developer:
      type: object
      description: Information about the app's developer
      properties:
        name:
          type: string
          description: Developer or company name
        link:
          type: string
          description: URL to the developer's website
        apple_link:
          type: string
          description: Link to the developer's profile on the App Store
    ReviewsHistogram:
      type: object
      description: Distribution of ratings across star levels
      properties:
        "1":
          type: integer
          description: Number of 1-star reviews
        "2":
          type: integer
          description: Number of 2-star reviews
        "3":
          type: integer
          description: Number of 3-star reviews
        "4":
          type: integer
          description: Number of 4-star reviews
        "5":
          type: integer
          description: Number of 5-star reviews
    Information:
      type: object
      description: |
        Detailed information about the app including pricing, compatibility, and content ratings.

        **Important**: This object contains dynamic keys that vary by country/language. Common keys in English include: `seller`, `size`, `category`, `compatibility`, `languages`, `advisory`, `in_app_purchases`, `copyright`, `price`. In other languages, keys will be localized (e.g., in German: `größe`, `kategorie`, `kompatibilität`, `sprachen`, `anbieter`).
      additionalProperties: true
      properties:
        seller:
          type: string
          description: Name of the app seller/publisher (English locale)
        size:
          type: string
          description: App file size (English locale)
        category:
          type: string
          description: App category or genre (English locale)
        compatibility:
          type: object
          description: Device compatibility requirements with summary and detailed items
          properties:
            summary:
              type: string
              description: Summary text of compatibility requirements
            items:
              type: array
              description: Detailed compatibility requirements for each device type
              items:
                type: object
                properties:
                  label:
                    type: string
                    description: Device name or requirement label
                  value:
                    type: string
                    description: Minimum OS version or requirement details
        languages:
          type: string
          description: Supported languages as comma-separated text (English locale)
        advisory:
          $ref: '#/components/schemas/Advisory'
        in_app_purchases:
          type: array
          description: List of in-app purchase options
          items:
            $ref: '#/components/schemas/InAppPurchase'
        copyright:
          type: string
          description: Copyright and legal information
        price:
          $ref: '#/components/schemas/Price'
    Advisory:
      type: object
      description: |
        Content rating and age advisory information with dynamic keys for content intensity levels.

        **Important**: This object has an `age_rating` field, plus additional dynamic keys representing content intensity levels (e.g., `infrequent`, `frequent`, `mild`) that contain arrays of content categories.
      additionalProperties: true
      properties:
        age_rating:
          type: string
          description: Age rating category (e.g., '4+', '12+', '17+')
        infrequent:
          type: array
          description: Content categories that appear infrequently
          items:
            type: string
        frequent:
          type: array
          description: Content categories that appear frequently
          items:
            type: string
        mild:
          type: array
          description: Content categories with mild intensity
          items:
            type: string
    InAppPurchase:
      type: object
      description: Information about an in-app purchase option
      properties:
        title:
          type: string
          description: Name of the in-app purchase
        formatted_price:
          type: string
          description: Localized price display (e.g., '$9.99')
    Price:
      type: object
      description: App pricing information
      properties:
        is_free:
          type: boolean
          description: Whether the app is free to download
        formatted_price:
          type: string
          description: Localized price display
        extracted_price:
          type: number
          format: float
          description: Numeric price value extracted from formatted_price
    Review:
      type: object
      description: A user review of the app
      properties:
        title:
          type: string
          description: Title of the review
        text:
          type: string
          description: Full text content of the review
        username:
          type: string
          description: Username of the reviewer
        rating:
          type: integer
          description: Star rating given (1-5)
        date:
          type: string
          description: ISO 8601 date when the review was posted
    Support:
      type: object
      description: App capability or feature supported by the app
      properties:
        name:
          type: string
          description: Name of the capability or feature
        description:
          type: string
          description: Description of the capability or feature
    VersionHistory:
      type: object
      description: Information about an app version release
      properties:
        version:
          type: string
          description: Version number (e.g., '1.2.3')
        notes:
          type: string
          description: Release notes describing changes in this version
        date:
          type: string
          format: date-time
          description: ISO 8601 date when this version was released
    AppPrivacy:
      type: object
      description: Privacy practices and data collection information
      properties:
        privacy_policy_link:
          type: string
          description: URL to the app's privacy policy
        data:
          type: array
          description: Details about data collection and usage
          items:
            $ref: '#/components/schemas/PrivacyData'
    PrivacyData:
      type: object
      description: Information about a specific type of data collected
      properties:
        type:
          type: string
          description: Type of privacy concern (e.g., 'Data Used to Track You')
        description:
          type: string
          description: Description of what this data is used for
        categories:
          type: array
          description: Specific data categories in this type
          items:
            type: string
    FeaturedIn:
      type: object
      description: An editorial feature or article mentioning the app
      properties:
        label:
          type: string
          description: Badge or label (e.g., 'Editor's Choice')
        title:
          type: string
          description: Title of the feature or article
        description:
          type: string
          description: Description or excerpt from the feature
        link:
          type: string
          description: URL to the full feature article
        image:
          type: string
          description: Image URL for the feature
    Event:
      type: object
      description: A promotional event or special feature for the app
      properties:
        event_id:
          type: string
          description: Unique identifier for this event
        type:
          type: string
          description: Type or kind of event
        title:
          type: string
          description: Title of the event
        description:
          type: string
          description: Detailed description of the event
        subtitle:
          type: string
          description: Subtitle or secondary description
        start_date:
          type: string
          description: Start date of the event
        end_date:
          type: string
          description: End date of the event
        thumbnail:
          type: string
          description: Image URL for the event thumbnail
    RelatedApps:
      type: object
      description: Apps related to the searched app
      properties:
        more_by_this_developer:
          type: array
          description: Other apps created by the same developer
          items:
            $ref: '#/components/schemas/RelatedApp'
        you_might_also_like:
          type: array
          description: Recommended apps based on users who also have this app
          items:
            $ref: '#/components/schemas/RelatedApp'
    RelatedApp:
      type: object
      description: Summary information about a related app
      properties:
        id:
          type: integer
          description: The app's product ID on the Apple App Store
        name:
          type: string
          description: Name of the related app
        description:
          type: string
          description: Short description or subtitle of the related app
        link:
          type: string
          description: Direct URL to the app on the App Store
        logo:
          type: string
          description: URL of the app's icon/logo image
    Accessibility:
      type: object
      description: An accessibility feature supported by the app
      properties:
        name:
          type: string
          description: Name of the accessibility feature
        description:
          type: string
          description: Description of the accessibility feature
        thumbnail:
          type: string
          description: Image URL for the accessibility feature
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
