openapi: 3.0.0
info:
  title: Vinted Search API
  description: |
    Search Vinted's second-hand catalog on any of its 27 country sites.

    Each result carries its Vinted item id, title, link, brand, size, condition, price, the price with Vinted's buyer protection fee, likes, seller and photos. Prices are in the site's currency, as text and as numbers. The text is the amount with a dot decimal and the currency symbol after it (e.g., `12.00 €`), which can differ from how Vinted's page prints the price.

    Brand, size and condition are text in the site's language, as Vinted prints them on the item. Filter by them with `brand_id`, `size_id` and `condition`. Vinted lists up to 96 items a page and 960 items a search.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Vinted Search
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: 'Search engine. Must be set to: `vinted_search`'
          schema:
            type: string
            enum: ["vinted_search"]
        - name: q
          in: query
          required: true
          description: Search text, up to 512 bytes of UTF-8.
          schema:
            type: string
            maxLength: 512
        - name: vinted_domain
          in: query
          required: false
          description: Vinted country site to search. It sets the items, the currency and the language of brand, size and condition text.
          schema:
            type: string
            enum: ["vinted.fr", "vinted.be", "vinted.es", "vinted.lu", "vinted.nl", "vinted.lt", "vinted.de", "vinted.at", "vinted.it", "vinted.co.uk", "vinted.pt", "vinted.com", "vinted.cz", "vinted.sk", "vinted.pl", "vinted.se", "vinted.ro", "vinted.hu", "vinted.dk", "vinted.fi", "vinted.hr", "vinted.gr", "vinted.ie", "vinted.ee", "vinted.lv", "vinted.si", "vinted.com.au"]
            default: "vinted.fr"
        - name: sort_by
          in: query
          required: false
          description: Sorts the results. `newest` puts the latest listings first. With `price_high_to_low`, a few items can sit out of order on sites outside the euro, as they do on Vinted's page.
          schema:
            type: string
            enum: ["relevance", "newest", "price_low_to_high", "price_high_to_low"]
            default: "relevance"
        - name: price_min
          in: query
          required: false
          description: Lowest price, in the site's currency.
          schema:
            type: number
            minimum: 0
            maximum: 1000000000
        - name: price_max
          in: query
          required: false
          description: Highest price, in the site's currency. It must not be lower than `price_min`.
          schema:
            type: number
            minimum: 0
            maximum: 1000000000
        - name: condition
          in: query
          required: false
          description: Item conditions to keep, comma-separated. Several conditions widen the results. Supported values are `new_with_tags`, `new_without_tags`, `very_good`, `good`, `satisfactory` and `not_fully_functional`, which Vinted uses for electronics.
          schema:
            type: string
            pattern: '^(new_with_tags|new_without_tags|very_good|good|satisfactory|not_fully_functional)(,(new_with_tags|new_without_tags|very_good|good|satisfactory|not_fully_functional))*$'
        - name: category_id
          in: query
          required: false
          description: Vinted category ids to search in, comma-separated, such as `5` for Men or `1904` for Women. Vinted shows a category's id in its catalog address, as in `catalog[]=5`. Up to 100 ids, each from 1 to 2147483647.
          schema:
            type: string
            pattern: '^[1-9]\d{0,9}(,[1-9]\d{0,9})*$'
        - name: brand_id
          in: query
          required: false
          description: Vinted brand ids to keep, comma-separated, such as `53` for Nike or `53,14` for Nike and adidas. Several brands widen the results. Vinted shows a brand's id in its catalog address, as in `brand_ids[]=53`. Up to 100 ids, each from 1 to 2147483647.
          schema:
            type: string
            pattern: '^[1-9]\d{0,9}(,[1-9]\d{0,9})*$'
        - name: size_id
          in: query
          required: false
          description: Vinted size ids to keep, comma-separated, such as `207`. Several sizes widen the results. Vinted shows a size's id in its catalog address, as in `size_ids[]=207`. Up to 100 ids, each from 1 to 2147483647.
          schema:
            type: string
            pattern: '^[1-9]\d{0,9}(,[1-9]\d{0,9})*$'
        - name: color_id
          in: query
          required: false
          description: Vinted color ids to keep, comma-separated, such as `1` for black or `12` for white. Several colors widen the results. Vinted shows a color's id in its catalog address, as in `color_ids[]=1`. Up to 100 ids, each from 1 to 255.
          schema:
            type: string
            pattern: '^[1-9]\d{0,2}(,[1-9]\d{0,2})*$'
        - name: material_id
          in: query
          required: false
          description: Vinted material ids to keep, comma-separated, such as `44` for cotton. Several materials widen the results. Vinted shows a material's id in its catalog address, as in `material_ids[]=44`. Up to 100 ids, each from 1 to 2147483647.
          schema:
            type: string
            pattern: '^[1-9]\d{0,9}(,[1-9]\d{0,9})*$'
        - name: page
          in: query
          required: false
          description: Page of results. Vinted lists up to 96 items a page and stops at page 10. The last page is the one whose `pagination` has no `next`.
          schema:
            type: integer
            minimum: 1
            maximum: 10
            default: 1
      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'
        organic_results:
          type: array
          description: Items Vinted lists for the search, in Vinted's order.
          items:
            $ref: '#/components/schemas/OrganicResult'
        pagination:
          $ref: '#/components/schemas/Pagination'
        error:
          type: string
          description: Why the search returned no items.
    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: "Vinted catalog page for this search"
        html_url:
          type: string
          description: "URL to view the raw results"
        json_url:
          type: string
          description: "URL to view JSON results"
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          description: Search engine used
        q:
          type: string
          description: The text searched for
        vinted_domain:
          type: string
          description: Vinted country site searched
        sort_by:
          type: string
          description: Sort order
        price_min:
          type: string
          description: Lowest price
        price_max:
          type: string
          description: Highest price
        condition:
          type: string
          description: Item conditions kept
        category_id:
          type: string
          description: Categories searched in
        brand_id:
          type: string
          description: Brands kept
        size_id:
          type: string
          description: Sizes kept
        color_id:
          type: string
          description: Colors kept
        material_id:
          type: string
          description: Materials kept
        page:
          type: integer
          description: Page of results
    OrganicResult:
      type: object
      required: [position, item_id]
      properties:
        position:
          type: integer
          description: Position of the item on this page of results.
        item_id:
          type: integer
          description: Vinted item id, the number in the item link.
        title:
          type: string
          description: Item title, as the seller wrote it.
        link:
          type: string
          description: Item page on Vinted.
        brand:
          type: string
          description: Brand as Vinted prints it on the item, which for some items includes the model.
        size:
          type: string
          description: Size as Vinted prints it on the item, in the site's own sizing and language.
        condition:
          type: string
          description: Condition as Vinted prints it on the item, in the site's language.
        price:
          type: string
          description: Price as text, the amount with a dot decimal and the currency symbol after it (e.g., `12.00 €`).
        extracted_price:
          type: number
          description: Numeric price.
        currency:
          type: string
          description: ISO 4217 code of the price's currency.
        total_price:
          type: string
          description: Price with Vinted's buyer protection fee, as text in the same format as `price`.
        extracted_total_price:
          type: number
          description: Numeric price with Vinted's buyer protection fee.
        likes:
          type: integer
          description: Number of members who marked the item as a favourite.
        is_sponsored:
          type: boolean
          description: Whether the seller pays Vinted to promote the item.
        seller:
          $ref: '#/components/schemas/Seller'
        thumbnail:
          type: string
          description: Item photo.
        image:
          type: string
          description: Item photo at full size.
    Seller:
      type: object
      description: Member who sells the item.
      required: [id]
      properties:
        id:
          type: integer
          description: Vinted member id.
        username:
          type: string
          description: Member's username.
        link:
          type: string
          description: Member's profile on Vinted.
        is_business:
          type: boolean
          description: Whether the seller is a business account.
    Pagination:
      type: object
      required: [current]
      properties:
        current:
          type: integer
          description: Current page.
        next:
          type: string
          description: Vinted catalog page with the next items.
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
