openapi: 3.0.0
info:
  title: Flipkart Product API
  description: |
    The Flipkart Product API returns a product's page on flipkart.com, India's online marketplace, by its Flipkart product ID. The product includes its title, brand, link, images and videos, the price in Indian rupees with the MRP, discount and best price after offers, the rating and review counts, stock state, the F-Assured tag, shipping and other fees, return policy, warranty and description, Flipkart's highlights and grouped specifications, the featured seller with its scores, the bank, EMI and exchange offers, the variants with their product IDs, and the category path.

    A product ID Flipkart does not know, or a product it no longer lists, returns an `error` message in place of the product.

    **Cross-linking**: The `product_id` of a Flipkart Search result, and the `product_id` of an option in `product.variants`, can be passed as the `product_id` parameter. The `category_id` of an entry in `product.categories` can be passed to the Flipkart Search API as its `category_id` parameter.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Flipkart Product
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Engine to use for the search
          schema:
            type: string
            enum: ["flipkart_product"]
            default: "flipkart_product"
        - name: product_id
          in: query
          required: true
          description: Flipkart product ID, the `pid` in a Flipkart product link, such as `MOBHQV9YZGYG64U7`. Books use their ISBN-13, such as `9788418173196`, or their ISBN-10.
          schema:
            type: string
            pattern: '^(?:[A-Za-z0-9]{16}|[0-9]{13}|[0-9]{9}[0-9Xx])$'
        - name: zero_retention
          in: query
          required: false
          description: Set to true to disable logging and persistent storage for this request. Enterprise plans only.
          schema:
            type: boolean
            default: false
      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'
        '403':
          description: Forbidden. Zero data retention is not available to the account, or the account requires `zero_retention=true`.
          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'
        product:
          $ref: '#/components/schemas/Product'
        error:
          type: string
          description: Error message for a product ID Flipkart does not know or no longer lists
    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: Flipkart URL of the product page
        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: Engine used for the search
        product_id:
          type: string
          description: Flipkart product ID
        zero_retention:
          type: boolean
          description: Whether zero data retention was requested
    Product:
      type: object
      required: [product_id, link]
      properties:
        product_id:
          type: string
          description: Flipkart product ID
        item_id:
          type: string
          description: Flipkart ID of the product page, the `itm` part of its link
        listing_id:
          type: string
          description: Flipkart listing ID of the featured seller's offer
        title:
          type: string
          description: Product title as Flipkart shows it, with the selected variant
        brand:
          type: string
          description: Brand name
        color:
          type: string
          description: Color of the product
        link:
          type: string
          description: Link to the product page on Flipkart
        rating:
          type: number
          description: Average star rating out of 5
        reviews:
          type: integer
          description: Number of star ratings
        reviews_with_text:
          type: integer
          description: Number of written reviews
        price:
          type: string
          description: Selling price as Flipkart shows it, in Indian rupees
        extracted_price:
          type: number
          description: Selling price in Indian rupees
        original_price:
          type: string
          description: Maximum retail price (MRP) as Flipkart shows it, in Indian rupees
        extracted_original_price:
          type: number
          description: Maximum retail price (MRP) in Indian rupees
        discount_percentage:
          type: integer
          description: Discount on the MRP in percent
        best_price:
          type: string
          description: Lowest price after offers as Flipkart shows it, in Indian rupees
        extracted_best_price:
          type: number
          description: Lowest price after offers in Indian rupees
        best_price_note:
          type: string
          description: Flipkart's note on the offers behind the best price
        is_out_of_stock:
          type: boolean
          description: Whether the product cannot be bought now
        is_assured:
          type: boolean
          description: Whether the product page carries the F-Assured tag
        extracted_shipping:
          type: number
          description: Shipping fee in Indian rupees
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          description: Fees Flipkart adds to the price, apart from shipping
        return_policy:
          type: string
          description: Return policy as Flipkart states it
        warranty:
          type: string
          description: Warranty summary
        description:
          type: string
          description: Product description
        highlights:
          type: array
          items:
            type: string
          description: Key features Flipkart highlights for the product
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/Attribute'
          description: Attributes Flipkart lists under the product highlights
        specifications:
          type: array
          items:
            $ref: '#/components/schemas/SpecificationGroup'
          description: Specifications grouped as Flipkart groups them
        seller:
          $ref: '#/components/schemas/Seller'
        offers:
          type: array
          items:
            $ref: '#/components/schemas/Offer'
          description: Bank, EMI and exchange offers for the product
        variants:
          type: array
          items:
            $ref: '#/components/schemas/Variant'
          description: Variant selectors, such as color, size or storage
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
          description: Category path of the product, from the broadest category to the narrowest
        main_image:
          type: string
          description: URL of the main product image
        images:
          type: array
          items:
            type: string
          description: URLs of the product images
        videos:
          type: array
          items:
            $ref: '#/components/schemas/Video'
          description: Videos in the product gallery
    Attribute:
      type: object
      required: [name, value]
      properties:
        name:
          type: string
          description: Attribute name
        value:
          type: string
          description: Attribute value
    SpecificationGroup:
      type: object
      required: [specifications]
      properties:
        name:
          type: string
          description: Specification group name
        specifications:
          type: array
          items:
            $ref: '#/components/schemas/Specification'
          description: Specifications in the group
    Specification:
      type: object
      required: [name, value]
      properties:
        name:
          type: string
          description: Specification name
        value:
          type: string
          description: Specification value
    Seller:
      type: object
      required: [name]
      description: Seller featured on the product page
      properties:
        name:
          type: string
          description: Seller name
        rating:
          type: number
          description: Seller rating out of 5
        time_on_flipkart:
          type: string
          description: How long the seller has sold on Flipkart, as Flipkart states it
        products_sold:
          type: string
          description: Number of products the seller has sold, as Flipkart abbreviates it
        quality_score:
          type: string
          description: Seller quality score as a percentage
        speed_score:
          type: string
          description: Seller speed score as a percentage
    Offer:
      type: object
      required: [title]
      properties:
        type:
          type: string
          description: Offer type, such as `bank_offer`, `emi_offer` or `exchange_offer`
        title:
          type: string
          description: Offer title
        discount:
          type: string
          description: Saving the offer gives
        providers:
          type: array
          items:
            $ref: '#/components/schemas/OfferProvider'
          description: Banks or cards that give the offer
    OfferProvider:
      type: object
      required: [name]
      properties:
        name:
          type: string
          description: Bank or card name
        description:
          type: string
          description: Card type and offer kind
        discount:
          type: string
          description: Saving the bank offer gives
        monthly_payment:
          type: string
          description: Monthly EMI payment in Indian rupees
        tenure:
          type: string
          description: EMI tenure
    Variant:
      type: object
      required: [options]
      properties:
        name:
          type: string
          description: Variant dimension, such as color or size
        selected:
          type: string
          description: Value of the product's own variant
        options:
          type: array
          items:
            $ref: '#/components/schemas/VariantOption'
          description: Values Flipkart shows for the dimension, out-of-stock ones included
    VariantOption:
      type: object
      required: [value]
      properties:
        value:
          type: string
          description: Variant value
        product_id:
          type: string
          description: Flipkart product ID of the variant
        link:
          type: string
          description: Link to the variant's product page on Flipkart
        thumbnail:
          type: string
          description: URL of the variant's image
        price:
          type: string
          description: Variant price as Flipkart shows it, in Indian rupees
        extracted_price:
          type: number
          description: Variant price in Indian rupees
        is_selected:
          type: boolean
          description: Whether the option is the requested product
        is_out_of_stock:
          type: boolean
          description: Whether the variant cannot be bought now
    Category:
      type: object
      required: [link]
      properties:
        name:
          type: string
          description: Category name
        category_id:
          type: string
          description: Flipkart category path
        link:
          type: string
          description: Link to the category on Flipkart
    Fee:
      type: object
      required: [name, fee, extracted_fee]
      properties:
        name:
          type: string
          description: Fee name, such as Protect Promise Fee
        fee:
          type: string
          description: Fee as Flipkart shows it, in Indian rupees
        extracted_fee:
          type: number
          description: Fee in Indian rupees
    Video:
      type: object
      required: [link]
      properties:
        link:
          type: string
          description: Link to the video, an HLS stream from Flipkart or a YouTube video
        thumbnail:
          type: string
          description: URL of the video thumbnail image
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
