{"id":42335373,"url":"https://github.com/techspecs/techspecs-python","last_synced_at":"2026-01-27T14:15:34.794Z","repository":{"id":57473775,"uuid":"473135268","full_name":"techspecs/techspecs-python","owner":"techspecs","description":"TechSpecs Python provides easy access to the standardized technical specifications of over 100,000 consumer electronics products, including smartphones, tablets, smartwatches, laptops, and more.","archived":false,"fork":false,"pushed_at":"2023-03-07T11:55:11.000Z","size":82,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-09T15:22:15.068Z","etag":null,"topics":["api","api-client","ecommerce","laptop","phonespecsapi","python","sdk","sdk-python","smartphone","smartwatch","specification","tablet","techspecs"],"latest_commit_sha":null,"homepage":"https://developer.techspecs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techspecs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-23T10:18:16.000Z","updated_at":"2023-09-08T16:58:22.000Z","dependencies_parsed_at":"2022-09-20T12:52:20.918Z","dependency_job_id":null,"html_url":"https://github.com/techspecs/techspecs-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techspecs/techspecs-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspecs%2Ftechspecs-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspecs%2Ftechspecs-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspecs%2Ftechspecs-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspecs%2Ftechspecs-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techspecs","download_url":"https://codeload.github.com/techspecs/techspecs-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techspecs%2Ftechspecs-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28814597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","ecommerce","laptop","phonespecsapi","python","sdk","sdk-python","smartphone","smartwatch","specification","tablet","techspecs"],"created_at":"2026-01-27T14:15:34.740Z","updated_at":"2026-01-27T14:15:34.787Z","avatar_url":"https://github.com/techspecs.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://techspecs.io/big-logo-light.svg\" alt=\"TechSpecs Logo\" width=\"200\" height=\"200\"\u003e\n\u003c/p\u003e\n\n# Introduction\n\nTechSpecs Python provides easy access to the standardized technical specifications of the world's consumer electronics, including the latest smartphones, tablets, smartwatches, laptops, monitors, TVs and more. \n\n# Database Stats\n\nAt TechSpecs, we are committed to providing the most comprehensive and up-to-date database of technical specifications for consumer electronics products. Here are some statistics on our current database:\n\nTotal number of products: 100,000+\n-   Brands: 400+\n-   Categories: 6 (Smartphones, Tablets, Smartwatches, Monitors, TVs, and Laptops)\n-   Technical specifications: Over 300 for each product, including dimensions, weight, display features, connectivity options, and more.\n-   Daily updates: We update our database on a daily basis to ensure that our API provides the most accurate and up-to-date technical specifications for the products you're interested in.\n\nWe take pride in providing a database that is comprehensive and reliable, and we are constantly working to expand and improve it. If you have any questions or issues, please don't hesitate to reach out to our support team for assistance.\n\n## API Key\n\n-   [Signup](https://techspecs.io/) to get your TechSpecs API Key\n\n## Requirements\n\n-   Python 3.6+\n\n\n## Installation\n\n```sh\npip install techspecs\n```\n\n## Usage\n\nThe library needs to be configured with your TechSpecs api key and base URL which is\navailable in your [TechSpecs Dashboard](https://techspecs.io/dashboard). \n\nSet `techspecs_api_key` to your key value and `techspecs_base_url` to your base value.\n\n### Product Search\n\n```python\n# Search for a product by name, version or features\nimport techspecs\nimport json\n\n# TechSpecs API base URL\ntechspecs_base_url = \"https://api.techspecs.io\"\n\n# TechSpecs API bearer token\ntechspecs_api_key = \"your_techspecs_api_key\"\n\nquery = {\n    'keyword': 'iPhone 13', # product name or version number to search \n    'category': '',      # product category to search (e.g. 'Smartphones', 'Tablets', or leave empty to search all categories)\n    'page': 0                # page number to fetch results from\n}\n\n# Output mode ('raw' or 'pretty')\nmode = 'pretty'\n\n# Search for a product by name, version, or features\ntry:\n    response = techspecs.product_search(techspecs_base_url, query, techspecs_api_key, mode=mode)\n    print(response)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n\n```\n\n\n### Product Details\n\n```python\n# Get the detailed specifications of a product\nimport techspecs\n\n# TechSpecs API base URL\ntechspecs_base_url = \"https://api.techspecs.io\"\n\n# TechSpecs API bearer token\ntechspecs_api_key = \"your_techspecs_api_key\"\n\n# TechSpecs product ID\ntechspecs_product_id = \"63e96260ff7af4b68a304e40\"\n\n# Query dictionary\nquery = {\n    \"productId\": techspecs_product_id\n}\n\n# Output mode ('raw' or 'pretty')\nmode = 'pretty'\n\ntry:\n    # Validate techspecs_product_id\n    if not isinstance(techspecs_product_id, str):\n        raise ValueError('TechSpecs Product ID should be a string.')\n\n    # Validate mode\n    if mode not in ['raw', 'pretty']:\n        raise ValueError('Invalid mode. Mode should be \"raw\" or \"pretty\".')\n\n    # Call TechSpecs API to get product details\n    response = techspecs.product_detail(techspecs_base_url, techspecs_product_id, techspecs_api_key, mode=mode)\n\n    # Print the product details\n    print(response)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n\n```\n\n\n### List all categories    \n```python\nimport techspecs\n\n# TechSpecs API base URL\ntechspecs_base_url = \"https://api.techspecs.io\"\n\n# TechSpecs API bearer token\ntechspecs_api_key = \"your_techspecs_api_key\"\n\n# Output mode ('raw' or 'pretty')\nmode = 'pretty'\n\n# Define constants\nDEFAULT_MODE = 'pretty'\nVALID_MODES = ['pretty', 'raw']\n\n# Validate parameters\ndef validate_parameters(mode=DEFAULT_MODE):\n    if mode not in VALID_MODES:\n        raise ValueError(f'Invalid mode: {mode}. Mode should be one of {VALID_MODES}.')\n\n# Validate search parameters\ntry:\n    validate_parameters(mode=mode)\nexcept ValueError as e:\n    print(f\"Invalid search parameters: {e}\")\n    exit()\n\n# Call TechSpecs API to get all categories\ntry:\n    response = techspecs.get_all_categories(techspecs_base_url, techspecs_api_key, mode=mode)\n    print(response)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n\n```\n\n\n### List all brands\n```python\nimport techspecs\n\n# TechSpecs API base URL\ntechspecs_base_url = \"https://api.techspecs.io\"\n\n# TechSpecs API bearer token\ntechspecs_api_key = \"your_techspecs_api_key\"\n\n# Output mode ('raw' or 'pretty')\nmode = 'pretty'\n\n# Define function to validate parameters\ndef validate_parameters(mode):\n    if mode not in ['raw', 'pretty']:\n        raise ValueError(f'Invalid mode: {mode}. Mode should be one of [\"raw\", \"pretty\"].')\n\n# Validate parameters\ntry:\n    validate_parameters(mode)\nexcept ValueError as e:\n    print(f\"Invalid parameters: {e}\")\n    exit()\n\n# Call TechSpecs API to get all brands\ntry:\n    response = techspecs.get_all_brands(techspecs_base_url, techspecs_api_key, mode=mode)\n    print(response)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n\n```\n\n\n### Advanced Search\n```python\n# List all products by brand, category and release date\nimport techspecs\nimport datetime\n\n# TechSpecs API base URL\ntechspecs_base_url = \"https://api.techspecs.io\"\n\n# TechSpecs API bearer token\ntechspecs_api_key = \"your_techspecs_api_key\"\n\n# Output mode ('raw' or 'pretty')\nmode = 'pretty'\n\n# Set constants\nDEFAULT_PAGE = 0\nDEFAULT_MODE = 'pretty'\nVALID_MODES = ['pretty', 'raw']\n\n# Define function to validate date format\ndef is_valid_date(date_str):\n    try:\n        datetime.datetime.strptime(date_str, '%Y-%m-%d')\n        return True\n    except ValueError:\n        return False\n\n# Define function to validate parameters\ndef validate_parameters(brand, category, date=None, page=DEFAULT_PAGE, mode=DEFAULT_MODE):\n    if not isinstance(brand, list):\n        raise ValueError('Brand should be a list.')\n    \n    if not isinstance(category, list):\n        raise ValueError('Category should be a list.')\n    \n    if date is not None:\n        if not isinstance(date, dict):\n            raise ValueError('Invalid date format. Date should be a dictionary with keys \"from\" and \"to\".')\n        elif 'from' not in date or 'to' not in date:\n            raise ValueError('Invalid date format. Date dictionary should have keys \"from\" and \"to\".')\n        elif not is_valid_date(date['from']) or not is_valid_date(date['to']):\n            raise ValueError('Invalid date format. Date should be in the format YYYY-MM-DD.')\n    \n    if not isinstance(page, int) or page \u003c 0:\n        raise ValueError('Page should be a non-negative integer.')\n    \n    if mode not in VALID_MODES:\n        raise ValueError(f'Invalid mode: {mode}. Mode should be one of {VALID_MODES}.')\n\n# Define search parameters\nbrand = [\"Apple\"]\ncategory = [\"Smartphones\"]\ndate = {\n    \"from\": \"2010-01-01\",\n    \"to\": \"2022-03-15\"\n}\npage = 0\n\n# Validate search parameters\ntry:\n    validate_parameters(brand, category, date=date, page=page, mode=mode)\nexcept ValueError as e:\n    print(f\"Invalid search parameters: {e}\")\n    exit()\n\n\n# Call TechSpecs API to get all products\ntry:\n    response = techspecs.get_all_products(techspecs_base_url, techspecs_api_key, brand, category, date, page, mode=mode)\n    print(response)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n\n```\n\n\n### Machine ID Search\n#### Search for Apple products by machine id\n```python\n# Search for an Apple product by machine id\nimport techspecs\n\n# TechSpecs API base URL\ntechspecs_base_url = \"https://api.techspecs.io\"\n\n# TechSpecs API bearer token\ntechspecs_api_key = \"your_techspecs_api_key\"\n\n# Serial number of the Apple machine to look up machineid_or_codename ex iphone 11,6\nmachine_id = \"iphone 11,6\"\n\n# Output mode ('raw' or 'pretty')\nmode = 'pretty'\n\n# Look up the Apple machine by its serial number\ntry:\n    response = techspecs.machine_id_search(techspecs_base_url, techspecs_api_key, machine_id, mode)\n    print(response)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechspecs%2Ftechspecs-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechspecs%2Ftechspecs-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechspecs%2Ftechspecs-python/lists"}