{"openapi":"3.0.0","info":{"title":"Sephora Product Search API","description":"API for searching products from Sephora based on user input. This API fetches data from the external Sephora API. It has a rate limit of 25 requests per 24 hours per IP address. Exceeding this limit will result in a 429 status code with an error message.","version":"1.0.0"},"servers":[{"url":"https://sephora-app.netlify.app/api"}],"paths":{"/sephora":{"get":{"summary":"Search for products","description":"Fetch product suggestions from Sephora based on the user's search term.","parameters":[{"name":"searchTerm","in":"query","required":true,"description":"The keyword to search for products.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"The page number for pagination (default is 1).","schema":{"type":"string","default":"1"}},{"name":"sortBy","in":"query","required":false,"description":"The sorting method for the results (default is 'NEW').","schema":{"type":"string","default":"NEW"}}],"responses":{"200":{"description":"A list of product suggestions","headers":{"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the current time window.","schema":{"type":"integer","example":25}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current time window.","schema":{"type":"integer","example":5}},"X-RateLimit-Reset":{"description":"The time at which the current rate limit window resets (in Unix timestamp).","schema":{"type":"integer","example":1633036800}}},"content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}},"400":{"description":"Bad request, missing search term","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Rate limit exceeded. Try again later!"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}},"components":{"schemas":{"Product":{"type":"object","properties":{"brandName":{"type":"string","description":"The brand name of the product."},"productId":{"type":"string","description":"The unique identifier for the product."},"rating":{"type":"string","description":"The rating of the product."},"displayName":{"type":"string","description":"The display name of the product."},"heroImage":{"type":"string","description":"URL of the product's hero image."},"targetUrl":{"type":"string","description":"URL to the product's page."},"currentSku":{"type":"object","properties":{"imageAltText":{"type":"string","description":"Alt text for the product image."}}}}}}}}