### Search Products using Python Source: https://github.com/techspecs/techspecs-api/blob/main/README.md Use this Python snippet to search for products by name. Ensure you have the 'requests' library installed and replace 'techspecs_api_key' with your actual API key. ```python import requests url = "https://api.techspecs.io/v4/product/search?query=iPhone%2014" headers = { "accept": "application/json", "Authorization": "Bearer techspecs_api_key", "content-type": "application/json" } response = requests.post(url, headers=headers) print(response.text) ``` -------------------------------- ### Search Products using Node.js SDK Source: https://github.com/techspecs/techspecs-api/blob/main/README.md This Node.js example demonstrates how to search for products using the TechSpecs API SDK. Replace 'techspecs_api_key' with your valid API key. ```javascript const sdk = require('api')('@techspecs/v3.0#5dlse1lclezifmcf'); sdk.searchProducts({query: 'iPhone%2014', authorization: 'Bearer techspecs_api_key'}) .then(({ data }) => console.log(data)) .catch(err => console.error(err)); ``` -------------------------------- ### Search Products using PHP Source: https://github.com/techspecs/techspecs-api/blob/main/README.md This PHP snippet shows how to perform a product search using Guzzle HTTP client. Remember to replace 'techspecs_api_key' with your API key and ensure the SDK is installed via Composer. ```php request('POST', 'https://api.techspecs.io/v4/product/search?query=iPhone%2014', [ 'headers' => [ 'Authorization' => 'Bearer techspecs_api_key', 'accept' => 'application/json', 'content-type' => 'application/json', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Product Search Source: https://github.com/techspecs/techspecs-api/blob/main/README.md Searches for products based on a query. Requires an API key for authentication. ```APIDOC ## Product Search ### Description Searches for products based on a query. Requires an API key for authentication. ### Method POST ### Endpoint https://api.techspecs.io/v4/product/search ### Query Parameters - **query** (string) - Required - The search query for the product. ### Headers - **Authorization** (string) - Required - Bearer token (e.g., Bearer techspecs_api_key). - **accept** (string) - Optional - Specifies the desired response format, e.g., application/json. - **content-type** (string) - Optional - Specifies the request body format, e.g., application/json. ### Request Example ```json { "query": "iPhone 14" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the search results. - **products** (array) - List of matching products. - **id** (string) - Unique identifier for the product. - **name** (string) - Name of the product. - **brand** (string) - Brand of the product. - **thumbnail** (string) - URL to the product's thumbnail image. #### Response Example ```json { "data": { "products": [ { "id": "6337171423344333", "name": "Apple iPhone 14", "brand": "Apple", "thumbnail": "https://cdn.techspecs.io/img/products/6337171423344333/thumb.png" } ] } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.