Resistor Color Code Calculator

FREEMIUM
Par carter383 | Mise à jour a month ago | Tools
Popularité

7 / 10

Latence

302ms

Niveau de service

100%

Health Check

100%

LISEZ-MOI

Resistor Color Code API Documentation

Overview

The Resistor Color Code API efficiently decodes resistor color codes, providing the corresponding value of the resistor. It intelligently adapts to different resistor configurations by interpreting the number of color bands specified by the user. Importantly, within the sequence of bands provided, the last two bands are always interpreted as the multiplier and tolerance, respectively, ensuring accurate calculation of the resistor’s value.

Supported Color Bands

Color Bands for Value

  • Colors: Black, Brown, Red, Orange, Yellow, Green, Blue, Violet, Grey, White

Multiplier Bands

  • Colors: Black, Brown, Red, Orange, Yellow, Green, Blue, Gold, Silver

Tolerance Bands

  • Colors: Brown, Red, Green, Blue, Violet, Gold, Silver

API Usage

This API accepts color bands as input and provides the resistor’s value, including its tolerance.

Python Code Example

To use the API, you can follow the Python code example below. This example demonstrates how to make a request to the API and retrieve the resistor value.

import requests

# API Endpoint
url = "https://resistor-color-code-calculator.p.rapidapi.com/Resistor_Color_Codes"

# Query Parameters: Specify the Resistor Color Bands
querystring = {"band":"Blue,Green,Red,Red,Silver"}

# Headers: Include your RapidAPI Key and Host
headers = {
    "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY_HERE",
    "X-RapidAPI-Host": "resistor-color-code-calculator.p.rapidapi.com"
}

# Sending a GET request to the API
response = requests.get(url, headers=headers, params=querystring)

# Printing the API Response
print(response.text())

Response Format

The response provided by the API is a string that represents the resistor’s value along with its tolerance. The format of the response is shown below:

  • Example Input: {"band":"Blue,Green,Red,Red,Silver"}
  • Response: "65.2kΩ ±10%"

This response indicates the resistor’s value is 65.2 kiloohms with a tolerance of ±10%.

Abonnés : 0
Créateur d'API :
Rapid account: Carter 383
carter383
carter383
Connectez-vous pour évaluer l'API
Note : 5 - Votes : 1