openapi: 3.0.0
info:
  title: Amazon Reviewer API
  description: |
    Retrieve an Amazon reviewer's public profile: name, photo, biography and influencer status, and their most recent reviews on an Amazon domain with rating, text, helpful votes, review images and the reviewed product.

    **Cross-linking**: The `profile.id` of a review returned by the Amazon Product API can be used as the `reviewer_id` of this API.
  version: 1.0.0
servers:
- url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Amazon Reviewer Search
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      parameters:
      - name: engine
        in: query
        required: true
        description: Search engine to use
        schema:
          type: string
          enum:
          - amazon_reviewer
      - name: reviewer_id
        in: query
        required: true
        description: Amazon reviewer ID, as in a reviewer's profile link (e.g. `AHBEI6Q4F4WHRIFK5CWQMRVPOQMA` in `amazon.com/gp/profile/amzn1.account.AHBEI6Q4F4WHRIFK5CWQMRVPOQMA`). The `amzn1.account.` prefix is optional.
        schema:
          type: string
          pattern: ^\s*(?:amzn1\.account\.)?[Aa][A-Za-z0-9]{27}\s*$
      - name: amazon_domain
        in: query
        required: false
        description: Amazon domain of the profile. A reviewer's reviews are listed per domain.
        schema:
          type: string
          enum:
          - amazon.ae
          - amazon.ca
          - amazon.co.jp
          - amazon.co.uk
          - amazon.com
          - amazon.com.au
          - amazon.com.be
          - amazon.com.br
          - amazon.com.tr
          - amazon.com.mx
          - amazon.de
          - amazon.es
          - amazon.eg
          - amazon.fr
          - amazon.in
          - amazon.ie
          - amazon.it
          - amazon.nl
          - amazon.pl
          - amazon.sa
          - amazon.se
          - amazon.sg
          - amazon.co.za
          default: amazon.com
      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'
        reviewer:
          $ref: '#/components/schemas/Reviewer'
        reviews:
          type: array
          description: The reviewer's most recent reviews on this domain, newest first, at most 30
          items:
            $ref: '#/components/schemas/Review'
        posts:
          type: array
          description: An influencer's latest storefront posts, videos, idea lists and photos, in page order
          items:
            $ref: '#/components/schemas/Post'
        error:
          type: string
          description: Error message when Amazon has no profile for the reviewer_id
    SearchMetadata:
      type: object
      required:
      - status
      - created_at
      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: Amazon URL for this search
        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
        reviewer_id:
          type: string
          description: Amazon reviewer ID, without the `amzn1.account.` prefix
        amazon_domain:
          type: string
          description: Amazon domain of the profile. A reviewer's reviews are listed per domain.
    Reviewer:
      type: object
      required:
      - reviewer_id
      - name
      - link
      - is_influencer
      properties:
        reviewer_id:
          type: string
          description: Amazon reviewer ID, usable as reviewer_id
        name:
          type: string
          description: Reviewer's public name
        biography:
          type: string
          description: Biography the reviewer wrote for their profile
        image:
          type: string
          description: URL of the reviewer's profile photo
        link:
          type: string
          description: URL of the reviewer's profile
        is_influencer:
          type: boolean
          description: Whether the reviewer is an Amazon Influencer with a storefront
        storefront_link:
          type: string
          description: URL of the influencer's storefront
        is_top_creator:
          type: boolean
          description: Whether the influencer has the Top Creator badge
    Review:
      type: object
      required:
      - position
      - id
      - link
      - rating
      properties:
        position:
          type: integer
          description: Position of the review in the list
        id:
          type: string
          description: Amazon review ID
        title:
          type: string
          description: Review title
        link:
          type: string
          description: URL of the review
        text:
          type: string
          description: Full review text
        rating:
          type: integer
          description: Star rating from 1 to 5
        helpful_votes:
          type: integer
          description: Number of people who found the review helpful
        images:
          type: array
          description: URLs of the images attached to the review
          items:
            type: string
        product:
          $ref: '#/components/schemas/ReviewProduct'
    ReviewProduct:
      type: object
      properties:
        title:
          type: string
          description: Title of the reviewed product
        thumbnail:
          type: string
          description: URL of the reviewed product's image
    Post:
      type: object
      required:
      - position
      - id
      - type
      - is_pinned
      properties:
        position:
          type: integer
          description: Position of the post on the storefront
        id:
          type: string
          description: ID of the post, the last part of its link
        type:
          type: string
          enum:
          - video
          - list
          - photo
          description: Kind of post
        title:
          type: string
          description: Title of the post
        link:
          type: string
          description: URL of the post's page on Amazon
        thumbnail:
          type: string
          description: URL of the post's cover image
        is_pinned:
          type: boolean
          description: Whether the influencer pinned the post to the top of their storefront
        likes:
          type: integer
          description: Number of likes the post has
        item_count:
          type: integer
          description: Number of products in the idea list
        duration:
          type: string
          description: Length of the video, as Amazon displays it
        video_link:
          type: string
          description: URL of the video stream
        products:
          type: array
          description: Products in the idea list, or featured in the video, as the storefront shows them
          items:
            $ref: '#/components/schemas/PostProduct'
    PostProduct:
      type: object
      required:
      - asin
      properties:
        asin:
          type: string
          description: ASIN of the product, usable as asin in the Amazon Product API
        link:
          type: string
          description: URL of the product page
        thumbnail:
          type: string
          description: URL of the product image
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
