openapi: 3.0.0
info:
  title: AliExpress Store Products API
  description: |
    List the products of an AliExpress store for a ship-to country, in the currency and language you ask for, with search inside the store, store categories, filters, sorting and pages of 40 products.
    Each product returns its price, original price and discount, rating, review count, orders, badges and category ids, and each page returns the seller and the store's categories.

    **Cross-linking**: The `id` of an entry in `categories` or its `subcategories` goes in `category_id`.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: AliExpress Store Products
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Engine used to retrieve the results.
          schema:
            type: string
            enum: ["aliexpress_store_products"]
        - name: store_id
          in: query
          required: true
          description: Number in the store's link, such as `1101705614` in aliexpress.com/store/1101705614.
          schema:
            type: string
            pattern: '^\s*[1-9]\d{0,14}\s*$'
        - name: q
          in: query
          required: false
          description: Search terms inside the store, without emoji or rare characters such as `𠮷`.
          schema:
            type: string
            maxLength: 100
        - name: category_id
          in: query
          required: false
          description: Id of a store category from `categories`.
          schema:
            type: string
            pattern: '^\s*\d{1,20}\s*$'
        - name: sort_by
          in: query
          required: false
          description: Order of the products.
          schema:
            type: string
            enum: ["best_match", "newest"]
            default: "best_match"
        - name: filter
          in: query
          required: false
          description: Keep only products with free shipping, new arrivals or the store's top sellers.
          schema:
            type: string
            enum: ["free_shipping", "new_arrivals", "top_selling"]
        - name: page
          in: query
          required: false
          description: Page of results, 40 products each.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 1
        - name: delivery_country
          in: query
          required: false
          description: Two-letter code of the country the products ship to.
          schema:
            type: string
            enum: ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CO", "CR", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]
            default: "US"
        - name: currency
          in: query
          required: false
          description: Three-letter code of the currency prices are shown in.
          schema:
            type: string
            enum: ["AED", "AMD", "ARS", "AUD", "AZN", "BDT", "BGN", "BHD", "BOB", "BRL", "BYN", "CAD", "CHF", "CLP", "CNY", "COP", "CRC", "CZK", "DKK", "DOP", "DZD", "EGP", "EUR", "FJD", "GBP", "GEL", "GTQ", "HKD", "HNL", "HUF", "IDR", "ILS", "INR", "ISK", "JOD", "JPY", "KES", "KGS", "KHR", "KRW", "KWD", "KZT", "LAK", "LKR", "MAD", "MDL", "MMK", "MNT", "MUR", "MXN", "MYR", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PHP", "PKR", "PLN", "QAR", "RON", "RSD", "RUB", "SAR", "SEK", "SGD", "THB", "TND", "TRY", "TWD", "UAH", "USD", "UYU", "UZS", "VND", "XAF", "XOF", "XPF", "ZAR"]
            default: "USD"
        - name: language
          in: query
          required: false
          description: Language of titles, badges and seller details.
          schema:
            type: string
            enum: ["ar_MA", "de_DE", "en_US", "es_ES", "fr_FR", "he_IL", "id_ID", "it_IT", "ja_JP", "ko_KR", "nl_NL", "pl_PL", "pt_BR", "th_TH", "tr_TR", "uk_UA"]
            default: "en_US"
      responses:
        '200':
          description: Successful response. An unknown store, a category the store lacks or a store without products carries an error.
          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
      required: [search_metadata, search_parameters]
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        seller:
          $ref: '#/components/schemas/Seller'
        search_information:
          $ref: '#/components/schemas/SearchInformation'
        organic_results:
          type: array
          description: Products on the requested page, in AliExpress's order.
          items:
            $ref: '#/components/schemas/OrganicResult'
        categories:
          type: array
          description: Categories the store sorts its products into.
          items:
            $ref: '#/components/schemas/Category'
        pagination:
          $ref: '#/components/schemas/Pagination'
        error:
          type: string
          description: Message explaining why the store has no products to show.
    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: "AliExpress 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
      required: [engine, store_id]
      properties:
        engine:
          type: string
          description: Engine used for the search.
        store_id:
          type: string
          description: Store number.
        q:
          type: string
          description: Search terms inside the store.
        category_id:
          type: string
          description: Store category.
        sort_by:
          type: string
          description: Order of the products.
        filter:
          type: string
          description: Filter applied to the products.
        page:
          type: integer
          description: Page of results.
        delivery_country:
          type: string
          description: Ship-to country.
        currency:
          type: string
          description: Currency of the prices.
        language:
          type: string
          description: Language of the results.
    Seller:
      type: object
      required: [id, name, link]
      properties:
        id:
          type: string
          description: Store's own number, accepted by `store_id` and sometimes different from the number in the request.
        name:
          type: string
          description: Store name.
        link:
          type: string
          description: Link to the store page.
        logo:
          type: string
          description: Store logo.
        country:
          type: string
          description: Country the seller is based in.
        opened_date:
          type: string
          format: date
          description: Date the store opened.
        positive_feedback_percent:
          type: number
          description: Share of positive reviews in the last six months, in percent.
        rating:
          type: number
          description: Store rating, out of 5.
        item_as_described_rating:
          type: number
          description: Score for items matching their description, out of 5.
        communication_rating:
          type: number
          description: Score for the seller's communication, out of 5.
        shipping_speed_rating:
          type: number
          description: Score for shipping speed, out of 5.
        followers:
          type: integer
          description: Number of followers, rounded as AliExpress shows it.
    SearchInformation:
      type: object
      properties:
        total_results:
          type: integer
          description: Number of products AliExpress reports for the request.
        currency:
          type: string
          description: Three-letter code of the currency the prices are in.
    OrganicResult:
      type: object
      required: [position, product_id, title, link, price, extracted_price, thumbnail, is_choice, has_free_shipping_badge, is_new_shopper_price, is_brand_plus, is_super_deal, has_sale_badge]
      properties:
        position:
          type: integer
          description: Position of the product on the page.
        product_id:
          type: string
          description: AliExpress product id.
        title:
          type: string
          description: Product title.
        link:
          type: string
          description: Link to the product page.
        price:
          type: string
          description: Price as AliExpress shows it.
        extracted_price:
          type: number
          description: Price as a number.
        original_price:
          type: string
          description: Price before the discount, as AliExpress shows it.
        extracted_original_price:
          type: number
          description: Price before the discount, as a number.
        discount:
          type: integer
          description: Discount in percent.
        rating:
          type: number
          description: Average star rating, out of 5.
        reviews:
          type: integer
          description: Number of reviews.
        sold:
          type: string
          description: Number of orders as AliExpress shows it.
        extracted_sold:
          type: integer
          description: Number of orders.
        badges:
          type: array
          description: Labels AliExpress shows on the product.
          items:
            type: string
        category_ids:
          type: array
          description: Ids of the product's AliExpress categories, from the top category to its own, which are not the store categories `category_id` takes.
          items:
            type: string
        thumbnail:
          type: string
          description: Main product image.
        is_choice:
          type: boolean
          description: Whether the product is an AliExpress Choice product.
        has_free_shipping_badge:
          type: boolean
          description: Whether the product shows a free shipping badge.
        is_new_shopper_price:
          type: boolean
          description: Whether the product shows a price for new shoppers.
        is_brand_plus:
          type: boolean
          description: Whether the product shows the Brand+ badge.
        is_super_deal:
          type: boolean
          description: Whether the product shows the SuperDeals badge.
        has_sale_badge:
          type: boolean
          description: Whether the product shows the badge of the current sale event.
    Category:
      type: object
      required: [id, name]
      properties:
        id:
          type: string
          description: Category id, accepted by `category_id`.
        name:
          type: string
          description: Category name.
        thumbnail:
          type: string
          description: Category image.
        subcategories:
          type: array
          description: Categories inside this one.
          items:
            $ref: '#/components/schemas/Subcategory'
    Subcategory:
      type: object
      required: [id, name]
      properties:
        id:
          type: string
          description: Category id, accepted by `category_id`.
        name:
          type: string
          description: Category name.
        thumbnail:
          type: string
          description: Category image.
    Pagination:
      type: object
      required: [current]
      properties:
        current:
          type: integer
          description: Current page.
        next:
          type: integer
          description: Next page, present while the store has more products.
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message.
