Global Unit Converter API

API ID 13008

Convert between 138 units across 19 categories with auto-detection, compound measurement parsing, batch conversion, locale formatting, and ingredient cooking conversions. Fast, stateless, and fully documented.

112 ms 平均响应

API 文档

端点

请求

Converts a single value from one unit to another, automatically detecting the category from the unit name. Returns the raw result at full precision and a human-readable formatted string.

Endpoint ID: 26090
GET https://zylalabs.com/api/13008/global+unit+converter+api/26090/convert+a+value
输入参数

Convert a Value — 端点功能

对象 描述
value 必需 The numeric value to convert.
from 必需 Source unit symbol or alias (e.g. km).
to 必需 Target unit symbol or alias (e.g. mi).
category 可选 Override to resolve an ambiguous unit name.
precision 可选 Decimal places for the formatted string (0-15, default 4).
locale 可选 BCP-47 locale for the formatted string (default en-US).

剩余免费测试请求:3 / 3。


输入参数

value
from
to
category
precision
locale
API 示例响应
JSON
{"success":true,"data":{"value":100,"from":"km","to":"mi","category":"length","result":62.13711922373339,"formatted":"62.1371 mi"},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
Convert a Value — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26090/convert+a+value?value=100&from=km&to=mi&category=length&precision=4&locale=en-US' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

Converts a value into every other unit in its category in a single call, with the source unit excluded. Ideal for building converter interfaces without one request per unit.

Endpoint ID: 26091
GET https://zylalabs.com/api/13008/global+unit+converter+api/26091/convert+to+all+units
输入参数

Convert to All Units — 端点功能

对象 描述
value 必需 The numeric value to convert.
from 必需 Source unit symbol or alias.
category 可选 Category override.
precision 可选 Decimal places (0-15).
locale 可选 BCP-47 locale.

剩余免费测试请求:3 / 3。


输入参数

value
from
category
precision
locale
API 示例响应
JSON
{"success":true,"data":{"value":1,"from":"m","category":"length","conversions":[{"to":"mm","result":1000,"formatted":"1,000.0000 mm"},{"to":"cm","result":100,"formatted":"100.0000 cm"},{"to":"km","result":0.001,"formatted":"0.0010 km"},{"to":"in","result":39.37007874015748,"formatted":"39.3701 in"},{"to":"ft","result":3.280839895013123,"formatted":"3.2808 ft"},{"to":"yd","result":1.0936132983377078,"formatted":"1.0936 yd"},{"to":"mi","result":0.0006213711922373339,"formatted":"0.0006 mi"},{"to":"nmi","result":0.0005399568034557236,"formatted":"0.0005 nmi"}]},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
Convert to All Units — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26091/convert+to+all+units?value=1&from=m&category=length&precision=2&locale=de-DE' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

解析人类输入的复合测量并将总量转换为目标单位。处理如5英尺11英寸、3磅4盎司、2小时30分钟等格式,以及英尺和英寸的简写。

Endpoint ID: 26092
GET https://zylalabs.com/api/13008/global+unit+converter+api/26092/parse+and+convert
输入参数

解析和转换 — 端点功能

对象 描述
input 必需 The compound measurement string to parse.
to 必需 Target unit symbol or alias.
category 可选 Category override.
precision 可选 Decimal places (0-15).
locale 可选 BCP-47 locale.

剩余免费测试请求:3 / 3。


输入参数

input
to
category
precision
locale
API 示例响应
JSON
{"success":true,"data":{"input":"5ft 11in","parsed":[{"value":5,"unit":"ft"},{"value":11,"unit":"in"}],"category":"length","to":"cm","result":180.33999999999997,"formatted":"180.3400 cm"},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
解析和转换 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26092/parse+and+convert?input=5ft 11in&to=cm' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

在单个请求中转换最多 50 个单位对 每个项目独立处理 因此失败的项目在线标记并不会中止批处理 响应包括一个摘要块

Endpoint ID: 26093
POST https://zylalabs.com/api/13008/global+unit+converter+api/26093/batch+convert
输入参数

批量转换 — 端点功能

对象 描述
请求体 必需 Json

剩余免费测试请求:3 / 3。


输入参数

API 示例响应
JSON
{"success":true,"data":{"results":[{"error":false,"value":100,"from":"km","to":"mi","category":"length","result":62.13711922373339,"formatted":"62.14 mi"},{"error":false,"value":0,"from":"C","to":"F","category":"temperature","result":32,"formatted":"32.00 F"},{"error":false,"value":1,"from":"GB","to":"MB","category":"data_storage","result":1000,"formatted":"1,000.00 MB"}],"summary":{"total":3,"successful":3,"failed":0}},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
批量转换 — 代码片段

curl --location --request POST 'https://zylalabs.com/api/13008/global+unit+converter+api/26093/batch+convert' --header 'Authorization: Bearer YOUR_API_KEY' 

--data-raw '{
  "conversions": [
    { "value": 100, "from": "km", "to": "mi" },
    { "value": 0, "from": "C", "to": "F" },
    { "value": 1, "from": "GB", "to": "MB" }
  ],
  "precision": 2
}'

    
请求

Expresses a value in the most readable unit of its category, so 0.005 m becomes 5 mm and 90 min becomes 1.5 h. Temperature and fuel-efficiency units pass through unchanged.

Endpoint ID: 26094
GET https://zylalabs.com/api/13008/global+unit+converter+api/26094/humanize+a+value
输入参数

Humanize a Value — 端点功能

对象 描述
value 必需 The numeric value to humanize.
unit 必需 The unit the value is currently in.
category 可选 Category override.
precision 可选 Decimal places (0-15).
locale 可选 BCP-47 locale.

剩余免费测试请求:3 / 3。


输入参数

value
unit
category
precision
locale
API 示例响应
JSON
{"success":true,"data":{"value":0.005,"unit":"m","category":"length","humanized_unit":"mm","result":5,"formatted":"5.0000 mm","humanized":true},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
Humanize a Value — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26094/humanize+a+value?value=0.005&unit=m' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

Converts between a volume unit and a mass unit for a specific ingredient using its average density. Works in both directions, and every result is flagged as approximate.

Endpoint ID: 26095
GET https://zylalabs.com/api/13008/global+unit+converter+api/26095/cooking+volume+to+mass
输入参数

Cooking Volume to Mass — 端点功能

对象 描述
from 必需 A volume unit or a mass unit.
to 必需 The opposite dimension from the 'from' unit.
ingredient 必需 Ingredient name or alias (e.g. flour)
precision 可选 Decimal places (0-15).
locale 可选 BCP-47 locale.
value 必需 The numeric value to convert.

剩余免费测试请求:3 / 3。


输入参数

from
to
ingredient
precision
locale
value
API 示例响应
JSON
{"success":true,"data":{"value":1,"from":"cup","to":"g","ingredient":"flour","density_g_per_ml":0.53,"result":125.39164,"formatted":"125.3916 g","approximate":true,"note":"Densities are averages and vary by ingredient, brand, and packing."},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
Cooking Volume to Mass — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26095/cooking+volume+to+mass?from=cup&to=g&ingredient=flour&value=1' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

Returns every supported cooking ingredient with its average density in grams per millilitre and a category label. Useful for populating ingredient pickers in a user interface.

Endpoint ID: 26096
GET https://zylalabs.com/api/13008/global+unit+converter+api/26096/list+ingredients
输入参数

剩余免费测试请求:3 / 3。

此端点不需要任何输入参数。

API 示例响应
JSON
{"success":true,"data":{"ingredients":[{"name":"All-Purpose Flour","aliases":["flour","ap flour","plain flour"],"density_g_per_ml":0.53,"category":"flour"},{"name":"Bread Flour","aliases":["bread flour","strong flour"],"density_g_per_ml":0.54,"category":"flour"},{"name":"Whole Wheat Flour","aliases":["whole wheat flour","wholemeal flour"],"density_g_per_ml":0.6,"category":"flour"},{"name":"Cake Flour","aliases":["cake flour","soft flour"],"density_g_per_ml":0.48,"category":"flour"},{"name":"Granulated Sugar","aliases":["sugar","white sugar"],"density_g_per_ml":0.85,"category":"sugar"},{"name":"Brown Sugar","aliases":["brown sugar","packed brown sugar"],"density_g_per_ml":0.93,"category":"sugar"},{"name":"Powdered Sugar","aliases":["powdered sugar","icing sugar","confectioners sugar"],"density_g_per_ml":0.56,"category":"sugar"},{"name":"Butter","aliases":["butter","unsalted butter"],"density_g_per_ml":0.959,"category":"fat"},{"name":"Water","aliases":["water","tap water"],"density_g_per_ml":1,"category":"liquid"},{"name":"Milk","aliases":["milk","whole milk"],"density_g_per_ml":1.03,"category":"dairy"},{"name":"Heavy Cream","aliases":["heavy cream","whipping cream"],"density_g_per_ml":1.01,"category":"dairy"},{"name":"Honey","aliases":["honey","raw honey"],"density_g_per_ml":1.42,"category":"sweetener"},{"name":"Vegetable Oil","aliases":["vegetable oil","cooking oil"],"density_g_per_ml":0.92,"category":"fat"},{"name":"Olive Oil","aliases":["olive oil","extra virgin olive oil"],"density_g_per_ml":0.91,"category":"fat"},{"name":"Rice","aliases":["rice","white rice","uncooked rice"],"density_g_per_ml":0.78,"category":"grain"},{"name":"Salt","aliases":["salt","table salt","fine salt"],"density_g_per_ml":1.2,"category":"seasoning"},{"name":"Cocoa Powder","aliases":["cocoa powder","cocoa","unsweetened cocoa"],"density_g_per_ml":0.51,"category":"baking"},{"name":"Baking Soda","aliases":["baking soda","bicarbonate of soda"],"density_g_per_ml":0.93,"category":"leavening"},{"name":"Baking Powder","aliases":["baking powder","double-acting baking powder"],"density_g_per_ml":0.81,"category":"leavening"},{"name":"Cornstarch","aliases":["cornstarch","corn starch","cornflour"],"density_g_per_ml":0.51,"category":"starch"},{"name":"Rolled Oats","aliases":["oats","rolled oats","old fashioned oats"],"density_g_per_ml":0.38,"category":"grain"},{"name":"Peanut Butter","aliases":["peanut butter","creamy peanut butter"],"density_g_per_ml":1.09,"category":"spread"},{"name":"Maple Syrup","aliases":["maple syrup","pure maple syrup"],"density_g_per_ml":1.32,"category":"sweetener"},{"name":"Yogurt","aliases":["yogurt","yoghurt","plain yogurt"],"density_g_per_ml":1.03,"category":"dairy"},{"name":"Sour Cream","aliases":["sour cream","soured cream"],"density_g_per_ml":0.96,"category":"dairy"},{"name":"Breadcrumbs","aliases":["breadcrumbs","bread crumbs","dried breadcrumbs"],"density_g_per_ml":0.46,"category":"baking"},{"name":"Parmesan Cheese","aliases":["parmesan","parmesan cheese","grated parmesan"],"density_g_per_ml":0.42,"category":"dairy"},{"name":"Chocolate Chips","aliases":["chocolate chips","choc chips"],"density_g_per_ml":0.72,"category":"baking"}]},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
List Ingredients — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26096/list+ingredients' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

Returns every supported unit grouped by category, each with its symbol, display name, accepted aliases, and category slug. Build dynamic unit pickers from this without hardcoding values.

Endpoint ID: 26097
GET https://zylalabs.com/api/13008/global+unit+converter+api/26097/list+all+units
输入参数

剩余免费测试请求:3 / 3。

此端点不需要任何输入参数。

API 示例响应
JSON
{"success":true,"data":{"categories":[{"category":"length","units":[{"symbol":"mm","name":"Millimeter","aliases":["millimeter","millimetre","millimeters","millimetres"]},{"symbol":"cm","name":"Centimeter","aliases":["centimeter","centimetre","centimeters","centimetres"]},{"symbol":"m","name":"Meter","aliases":["meter","metre","meters","metres"]},{"symbol":"km","name":"Kilometer","aliases":["kilometer","kilometre","kilometers","kilometres"]},{"symbol":"in","name":"Inch","aliases":["inch","inches","\""]},{"symbol":"ft","name":"Foot","aliases":["foot","feet","'"]},{"symbol":"yd","name":"Yard","aliases":["yard","yards"]},{"symbol":"mi","name":"Mile","aliases":["mile","miles"]},{"symbol":"nmi","name":"Nautical Mile","aliases":["nautical mile","nautical miles"]}]},{"category":"mass","units":[{"symbol":"mg","name":"Milligram","aliases":["milligram","milligrams"]},{"symbol":"g","name":"Gram","aliases":["gram","grams","gramme","grammes"]},{"symbol":"kg","name":"Kilogram","aliases":["kilogram","kilograms","kilo","kilos"]},{"symbol":"t","name":"Tonne","aliases":["tonne","tonnes","metric ton","metric tons"]},{"symbol":"oz","name":"Ounce","aliases":["ounce","ounces"]},{"symbol":"lb","name":"Pound","aliases":["pound","pounds","lbs"]},{"symbol":"st","name":"Stone","aliases":["stone","stones"]},{"symbol":"ton","name":"US Ton","aliases":["us ton","us tons","short ton","short tons"]}]},{"category":"temperature","units":[{"symbol":"C","name":"Celsius","aliases":["celsius","degc","°c"]},{"symbol":"F","name":"Fahrenheit","aliases":["fahrenheit","degf","°f"]},{"symbol":"K","name":"Kelvin","aliases":["kelvin","degk","°k"]},{"symbol":"R","name":"Rankine","aliases":["rankine","degr","°r"]}]},{"category":"volume","units":[{"symbol":"ml","name":"Milliliter","aliases":["milliliter","millilitre","milliliters","millilitres"]},{"symbol":"l","name":"Liter","aliases":["liter","litre","liters","litres"]},{"symbol":"m3","name":"Cubic Meter","aliases":["cubic meter","cubic metre","cubic meters","m^3"]},{"symbol":"tsp","name":"Teaspoon","aliases":["teaspoon","teaspoons"]},{"symbol":"tbsp","name":"Tablespoon","aliases":["tablespoon","tablespoons"]},{"symbol":"fl_oz_us","name":"US Fluid Ounce","aliases":["fl_oz","fl oz","floz","fluid ounce","us fluid ounce"]},{"symbol":"fl_oz_uk","name":"UK Fluid Ounce","aliases":["imperial fluid ounce","uk fluid ounce","imperial fl oz"]},{"symbol":"cup_us","name":"US Cup","aliases":["cup","cups","us cup"]},{"symbol":"cup_metric","name":"Metric Cup","aliases":["metric cup","metric cups"]},{"symbol":"pt_us","name":"US Pint","aliases":["pt","pint","pints","us pint"]},{"symbol":"pt_uk","name":"UK Pint","aliases":["imperial pint","uk pint"]},{"symbol":"qt_us","name":"US Quart","aliases":["qt","quart","quarts","us quart"]},{"symbol":"qt_uk","name":"UK Quart","aliases":["imperial quart","uk quart"]},{"symbol":"gal_us","name":"US Gallon","aliases":["gal","gallon","gallons","us gallon"]},{"symbol":"gal_uk","name":"UK Gallon","aliases":["imperial gallon","uk gallon"]}]},{"category":"speed","units":[{"symbol":"m/s","name":"Meters per Second","aliases":["meters per second","metres per second","mps"]},{"symbol":"km/h","name":"Kilometers per Hour","aliases":["kilometers per hour","kmh","kph"]},{"symbol":"mph","name":"Miles per Hour","aliases":["miles per hour","mi/h"]},{"symbol":"knot","name":"Knot","aliases":["knots","nautical mph"]},{"symbol":"ft/s","name":"Feet per Second","aliases":["feet per second","fps"]}]},{"category":"area","units":[{"symbol":"mm2","name":"Square Millimeter","aliases":["square millimeter","square millimetre","mm^2"]},{"symbol":"cm2","name":"Square Centimeter","aliases":["square centimeter","square centimetre","cm^2"]},{"symbol":"m2","name":"Square Meter","aliases":["square meter","square metre","m^2"]},{"symbol":"km2","name":"Square Kilometer","aliases":["square kilometer","square kilometre","km^2"]},{"symbol":"in2","name":"Square Inch","aliases":["square inch","square inches","in^2"]},{"symbol":"ft2","name":"Square Foot","aliases":["square foot","square feet","ft^2"]},{"symbol":"yd2","name":"Square Yard","aliases":["square yard","square yards","yd^2"]},{"symbol":"ac","name":"Acre","aliases":["acre","acres"]},{"symbol":"ha","name":"Hectare","aliases":["hectare","hectares"]}]},{"category":"energy","units":[{"symbol":"J","name":"Joule","aliases":["joule","joules"]},{"symbol":"kJ","name":"Kilojoule","aliases":["kilojoule","kilojoules"]},{"symbol":"cal","name":"Calorie","aliases":["calorie","calories","small calorie"]},{"symbol":"kcal","name":"Kilocalorie","aliases":["kilocalorie","kilocalories","food calorie"]},{"symbol":"Wh","name":"Watt Hour","aliases":["watt hour","watt-hour","watthour"]},{"symbol":"kWh","name":"Kilowatt Hour","aliases":["kilowatt hour","kilowatt-hour","kwh"]},{"symbol":"BTU","name":"British Thermal Unit","aliases":["btu","british thermal unit","british thermal units"]},{"symbol":"eV","name":"Electronvolt","aliases":["electronvolt","electron volt","ev"]}]},{"category":"pressure","units":[{"symbol":"Pa","name":"Pascal","aliases":["pascal","pascals"]},{"symbol":"kPa","name":"Kilopascal","aliases":["kilopascal","kilopascals"]},{"symbol":"MPa","name":"Megapascal","aliases":["megapascal","megapascals"]},{"symbol":"bar","name":"Bar","aliases":["bars","metric bar"]},{"symbol":"psi","name":"Pounds per Square Inch","aliases":["pound per square inch","pounds per square inch","lbf/in2"]},{"symbol":"atm","name":"Atmosphere","aliases":["atmosphere","atmospheres","standard atmosphere"]},{"symbol":"mmHg","name":"Millimeters of Mercury","aliases":["millimeters of mercury","millimetres of mercury","torr"]},{"symbol":"inHg","name":"Inches of Mercury","aliases":["inches of mercury","in hg"]}]},{"category":"data_storage","units":[{"symbol":"bit","name":"Bit","aliases":["bits","binary digit"]},{"symbol":"B","name":"Byte","aliases":["byte","bytes"]},{"symbol":"KB","name":"Kilobyte","aliases":["kilobyte","kilobytes"]},{"symbol":"MB","name":"Megabyte","aliases":["megabyte","megabytes"]},{"symbol":"GB","name":"Gigabyte","aliases":["gigabyte","gigabytes"]},{"symbol":"TB","name":"Terabyte","aliases":["terabyte","terabytes"]},{"symbol":"PB","name":"Petabyte","aliases":["petabyte","petabytes"]},{"symbol":"KiB","name":"Kibibyte","aliases":["kibibyte","kibibytes"]},{"symbol":"MiB","name":"Mebibyte","aliases":["mebibyte","mebibytes"]},{"symbol":"GiB","name":"Gibibyte","aliases":["gibibyte","gibibytes"]},{"symbol":"TiB","name":"Tebibyte","aliases":["tebibyte","tebibytes"]}]},{"category":"fuel_efficiency","units":[{"symbol":"mpg_us","name":"US Miles per Gallon","aliases":["mpg","us mpg","miles per gallon"]},{"symbol":"mpg_uk","name":"UK Miles per Gallon","aliases":["uk mpg","imperial mpg"]},{"symbol":"L/100km","name":"Liters per 100 Kilometers","aliases":["l/100km","liters per 100km","litres per 100km"]},{"symbol":"km/L","name":"Kilometers per Liter","aliases":["km/l","kilometers per liter","kilometres per litre"]}]},{"category":"time","units":[{"symbol":"ns","name":"Nanosecond","aliases":["nanosecond","nanoseconds"]},{"symbol":"us","name":"Microsecond","aliases":["microsecond","microseconds"]},{"symbol":"ms","name":"Millisecond","aliases":["millisecond","milliseconds"]},{"symbol":"s","name":"Second","aliases":["second","seconds","sec"]},{"symbol":"min","name":"Minute","aliases":["minute","minutes"]},{"symbol":"h","name":"Hour","aliases":["hour","hours","hr"]},{"symbol":"day","name":"Day","aliases":["days","d"]},{"symbol":"week","name":"Week","aliases":["weeks","wk"]},{"symbol":"month","name":"Month","aliases":["months","mo"]},{"symbol":"year","name":"Year","aliases":["years","yr"]}]},{"category":"angle","units":[{"symbol":"deg","name":"Degree","aliases":["degree","degrees","°"]},{"symbol":"rad","name":"Radian","aliases":["radian","radians"]},{"symbol":"grad","name":"Gradian","aliases":["gradian","gradians","gon"]},{"symbol":"arcmin","name":"Arcminute","aliases":["arcminute","arcminutes","minute of arc"]},{"symbol":"arcsec","name":"Arcsecond","aliases":["arcsecond","arcseconds","second of arc"]},{"symbol":"turn","name":"Turn","aliases":["turns","revolution","revolutions"]}]},{"category":"frequency","units":[{"symbol":"Hz","name":"Hertz","aliases":["hertz","hz"]},{"symbol":"kHz","name":"Kilohertz","aliases":["kilohertz","khz"]},{"symbol":"MHz","name":"Megahertz","aliases":["megahertz","mhz"]},{"symbol":"GHz","name":"Gigahertz","aliases":["gigahertz","ghz"]},{"symbol":"THz","name":"Terahertz","aliases":["terahertz","thz"]},{"symbol":"rpm","name":"Revolutions per Minute","aliases":["revolutions per minute","rev/min"]}]},{"category":"power","units":[{"symbol":"W","name":"Watt","aliases":["watt","watts"]},{"symbol":"kW","name":"Kilowatt","aliases":["kilowatt","kilowatts"]},{"symbol":"MW","name":"Megawatt","aliases":["megawatt","megawatts"]},{"symbol":"hp","name":"Horsepower","aliases":["horsepower","mechanical horsepower"]},{"symbol":"PS","name":"Metric Horsepower","aliases":["metric horsepower","ps","pferdestarke"]},{"symbol":"BTU/h","name":"BTU per Hour","aliases":["btu/h","btu per hour","british thermal units per hour"]}]},{"category":"force","units":[{"symbol":"N","name":"Newton","aliases":["newton","newtons"]},{"symbol":"kN","name":"Kilonewton","aliases":["kilonewton","kilonewtons"]},{"symbol":"lbf","name":"Pound-Force","aliases":["pound-force","pound force","poundforce"]},{"symbol":"kgf","name":"Kilogram-Force","aliases":["kilogram-force","kilogram force"]},{"symbol":"dyn","name":"Dyne","aliases":["dyne","dynes"]}]},{"category":"data_rate","units":[{"symbol":"bps","name":"Bits per Second","aliases":["bit/s","bits per second"]},{"symbol":"Kbps","name":"Kilobits per Second","aliases":["kbps","kilobits per second"]},{"symbol":"Mbps","name":"Megabits per Second","aliases":["mbps","megabits per second"]},{"symbol":"Gbps","name":"Gigabits per Second","aliases":["gbps","gigabits per second"]},{"symbol":"Tbps","name":"Terabits per Second","aliases":["tbps","terabits per second"]},{"symbol":"KB/s"}]}]},"_note":"Response truncated for documentation purposes"}
List All Units — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26097/list+all+units' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求
返回单个类别的所有单位,例如长度或温度。未知类别的标识符将返回标准错误格式的404错误
Endpoint ID: 26098
GET https://zylalabs.com/api/13008/global+unit+converter+api/26098/list+units+by+category
输入参数

剩余免费测试请求:3 / 3。

API 示例响应
JSON
{"success":true,"data":{"category":"temperature","units":[{"symbol":"C","name":"Celsius","aliases":["celsius","degc","°c"]},{"symbol":"F","name":"Fahrenheit","aliases":["fahrenheit","degf","°f"]},{"symbol":"K","name":"Kelvin","aliases":["kelvin","degk","°k"]},{"symbol":"R","name":"Rankine","aliases":["rankine","degr","°r"]}]},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
按类别列出单位 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26098/list+units+by+category&category=Required' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

Fuzzy search across unit symbols, names, and aliases, ranked by exact match, then prefix, then substring. Returns up to 20 matches, which is ideal for autocomplete fields.

Endpoint ID: 26099
GET https://zylalabs.com/api/13008/global+unit+converter+api/26099/search+units
输入参数

Search Units — 端点功能

对象 描述
q 必需 The search term (symbol, name, or alias fragment).

剩余免费测试请求:3 / 3。


输入参数

q
API 示例响应
JSON
{"success":true,"data":{"query":"meter","results":[{"symbol":"mm","name":"Millimeter","category":"length"},{"symbol":"cm","name":"Centimeter","category":"length"},{"symbol":"m","name":"Meter","category":"length"},{"symbol":"km","name":"Kilometer","category":"length"},{"symbol":"m3","name":"Cubic Meter","category":"volume"},{"symbol":"m/s","name":"Meters per Second","category":"speed"},{"symbol":"km/h","name":"Kilometers per Hour","category":"speed"},{"symbol":"mm2","name":"Square Millimeter","category":"area"},{"symbol":"cm2","name":"Square Centimeter","category":"area"},{"symbol":"m2","name":"Square Meter","category":"area"},{"symbol":"km2","name":"Square Kilometer","category":"area"},{"symbol":"mmHg","name":"Millimeters of Mercury","category":"pressure"},{"symbol":"L/100km","name":"Liters per 100 Kilometers","category":"fuel_efficiency"},{"symbol":"km/L","name":"Kilometers per Liter","category":"fuel_efficiency"},{"symbol":"kg/m3","name":"Kilograms per Cubic Meter","category":"density"},{"symbol":"g/cm3","name":"Grams per Cubic Centimeter","category":"density"},{"symbol":"N·m","name":"Newton Meter","category":"torque"},{"symbol":"kN·m","name":"Kilonewton Meter","category":"torque"},{"symbol":"kgf·m","name":"Kilogram-Force Meter","category":"torque"},{"symbol":"m3/s","name":"Cubic Meters per Second","category":"flow_rate"}]},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
Search Units — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26099/search+units?q=meter' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

返回所有19个支持的类别,每个类别都有一个显示名称和它包含的单位数量。使用此方法来渲染类别选择器,而无需硬编码列表

Endpoint ID: 26100
GET https://zylalabs.com/api/13008/global+unit+converter+api/26100/list+categories
输入参数

剩余免费测试请求:3 / 3。

此端点不需要任何输入参数。

API 示例响应
JSON
{"success":true,"data":{"categories":[{"category":"length","display_name":"Length","unit_count":9},{"category":"mass","display_name":"Mass","unit_count":8},{"category":"temperature","display_name":"Temperature","unit_count":4},{"category":"volume","display_name":"Volume","unit_count":15},{"category":"speed","display_name":"Speed","unit_count":5},{"category":"area","display_name":"Area","unit_count":9},{"category":"energy","display_name":"Energy","unit_count":8},{"category":"pressure","display_name":"Pressure","unit_count":8},{"category":"data_storage","display_name":"Data Storage","unit_count":11},{"category":"fuel_efficiency","display_name":"Fuel Efficiency","unit_count":4},{"category":"time","display_name":"Time","unit_count":10},{"category":"angle","display_name":"Angle","unit_count":6},{"category":"frequency","display_name":"Frequency","unit_count":6},{"category":"power","display_name":"Power","unit_count":6},{"category":"force","display_name":"Force","unit_count":5},{"category":"data_rate","display_name":"Data Rate","unit_count":8},{"category":"density","display_name":"Density","unit_count":5},{"category":"torque","display_name":"Torque","unit_count":5},{"category":"flow_rate","display_name":"Flow Rate","unit_count":6}]},"meta":{"disclaimer":"Conversion results are calculated from standard mathematical constants. Always verify safety-critical conversions independently.","cached":false}}
列表类别 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26100/list+categories' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求

Returns the API status including uptime, version, total unit and category counts, ingredient count, endpoint count, and a feature flag object indicating which capabilities are enabled.

Endpoint ID: 26101
GET https://zylalabs.com/api/13008/global+unit+converter+api/26101/health+check
输入参数

剩余免费测试请求:3 / 3。

此端点不需要任何输入参数。

API 示例响应
JSON
{"uptime":431467.947423891,"version":"1.0.0","total_unit_count":138,"category_count":19,"ingredient_count":28,"endpoint_count":13,"features":{"convert":true,"convert_all":true,"convert_parse":true,"convert_batch":true,"humanize":true,"cooking":true,"unit_search":true,"openapi_spec":true,"cors":true}}
Health Check — 代码片段

curl --location --request GET 'https://zylalabs.com/api/13008/global+unit+converter+api/26101/health+check' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API 访问密钥和身份验证

注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 Global Unit Converter API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。

标头
标头 描述
授权 必需 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。

简单透明的定价

无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。

(年度计费可节省 2 个月 🎉)

🚀 企业版套餐
自定义数量

  • 自定义速率限制
  • 团队与权限管理
  • SLA 保障的稳定性
  • 专业客户支持
  • 实时 API 监控
  • 企业级安全与合规
最低年度合同:10,000 美元

领先企业的信赖之选

概览

The Global Unit Converter API converts values between units across 19 categories: length, mass, temperature, volume, speed, area, energy, pressure, data storage, fuel efficiency, time, angle, frequency, power, force, data rate, density, torque, and flow rate — 138 units in total.

It detects the category automatically from the unit you pass, so you never have to specify it. Every conversion returns both a raw result at full floating-point precision and a human-readable formatted string, with caller-controlled decimal precision and locale-aware number formatting (so the same value can render as 62.14 or 62,14 depending on the locale).

Beyond single conversions, the API does the things developers usually have to build by hand:

- Convert to all units: express a value in every other unit of its category in one call, ideal for building converter UIs without a request per unit.
- Compound measurement parsing: parse human-typed input like 5'11", 3 lb 4 oz, and 2h 30min, including feet and inches shorthand, and convert the total.
- Batch conversion: convert up to 50 unit pairs in a single request, with failed items flagged inline so one bad pair never aborts the batch.
- Readable-unit humanizer: express a value in the most readable unit of its category, so 0.005 m becomes 5 mm and 90 minutes becomes 1.5 hours.
- Cooking conversions: convert between volume and mass for common ingredients using average densities, so 1 cup of flour becomes about 125 grams.
- Unit discovery and fuzzy search: list every unit, category, and ingredient, and search units by symbol, name, or alias for autocomplete fields.

The API correctly distinguishes US and imperial units, providing both variants for gallon, quart, pint, and fluid ounce, so conversions are regionally accurate rather than silently wrong.

It is fully stateless — there is no database and no external data at runtime. Every conversion factor is a fixed mathematical constant, so responses are fast, deterministic, and never go out of date. The API is CORS-enabled for direct browser use and returns a consistent JSON envelope on every response, with clear, machine-readable error codes.

 

Global Unit Converter API FAQs

No. The category is detected automatically from the unit you pass, so a request like from=km&to=mi just works. You only need the optional category parameter in the rare case where a unit name could belong to more than one category, and even then the unit set is built to avoid those collisions, so in practice you'll almost never need it.

Result is the raw conversion at full floating-point precision — use it for your own calculations. formatted is a display-ready string rounded to the precision you request (default 4 decimals) and formatted for the locale you request (default en-US). Changing precision or locale only affects formatted; result always stays at full precision.

You can convert between any two units within the same category — kilometres to miles, Celsius to Fahrenheit, gigabytes to mebibytes. Conversions across different categories are not valid and return an error, since there is no meaningful conversion between, say, a distance and a weight. The cooking endpoint is the one deliberate exception, converting between volume and mass for specific ingredients using their density.

加仑、夸脱、品脱和液盎司在美国和英制(英国)系统中有所不同,因此都提供了像 gal_us 和 gal_uk 这样明确的名称。如果你传递一个裸单位如 gal、pt 或 cup,它会解析为美国变体。要强制使用英制,请使用明确的英国符号

Cooking conversions use average densities for each ingredient and are explicitly flagged as approximate in every response. Real densities vary by brand, sifting, and packing, so treat the result as a close estimate suitable for recipes rather than a precise measurement.

不 API是完全无状态的没有数据库 您提交的值和单位在内存中处理以计算响应并且从不存储 每个转换因子都是一个固定的数学常数 所以结果快速 确定并且永远不会过时

Yes. The units, categories, and ingredient-listing endpoints return the complete catalogue of everything the API supports, including symbols, names, and aliases. You can build dynamic unit and category pickers directly from these responses without hardcoding any values.

Each endpoint returns JSON data structured with a success flag, data object, and meta information. The data object varies by endpoint; for example, the "Convert a Value" endpoint returns the conversion result, while "List Units" provides unit details grouped by category.

Key fields include "success" (boolean), "data" (contains conversion results or lists), and "meta" (provides additional info like disclaimers). For conversion endpoints, "result" and "formatted" fields show the raw and human-readable outputs, respectively.

Parameters vary by endpoint. For "Convert a Value," you need "from" and "to" units. The "Batch Convert" endpoint accepts an array of unit pairs. Optional parameters include "precision" for decimal control and "locale" for formatting.

The response data is organized into three main sections: "success" indicates if the request was successful, "data" contains the relevant output (like conversion results or lists), and "meta" provides additional context, such as disclaimers or caching status.

Each endpoint provides specific information: "Convert a Value" gives conversion results, "List Units" details available units, "Parse and Convert" interprets compound measurements, and "Cooking Volume to Mass" offers ingredient-specific conversions.

用户可以通过指定“从”、“到”、“精度”和“地区”等参数来定制请求 对于批量转换,用户可以在单个请求中提交多个单位对,从而实现高效的转换处理

典型的用例包括构建单位转换器应用程序 在电子商务平台中集成测量转换 开发用于教学测量的教育工具 和创建需要成分转换的食谱应用程序

Data accuracy is maintained through fixed mathematical constants for conversions, ensuring consistent results. The API is stateless, meaning it does not rely on external data sources, and every conversion is calculated independently, providing reliable outputs.

一般常见问题

Zyla API Hub 就像一个大型 API 商店,您可以在一个地方找到数千个 API。我们还为所有 API 提供专门支持和实时监控。注册后,您可以选择要使用的 API。请记住,每个 API 都需要自己的订阅。但如果您订阅多个 API,您将为所有这些 API 使用相同的密钥,使事情变得更简单。
价格以 USD(美元)、EUR(欧元)、CAD(加元)、AUD(澳元)和 GBP(英镑)列出。我们接受所有主要的借记卡和信用卡。我们的支付系统使用最新的安全技术,由 Stripe 提供支持,Stripe 是世界上最可靠的支付公司之一。如果您在使用卡片付款时遇到任何问题,请通过 [email protected]

此外,如果您已经以这些货币中的任何一种(USD、EUR、CAD、AUD、GBP)拥有有效订阅,该货币将保留用于后续订阅。只要您没有任何有效订阅,您可以随时更改货币。
定价页面上显示的本地货币基于您 IP 地址的国家/地区,仅供参考。实际价格以 USD(美元)为单位。当您付款时,即使您在我们的网站上看到以本地货币显示的等值金额,您的卡片对账单上也会以美元显示费用。这意味着您不能直接使用本地货币付款。
有时,银行可能会因其欺诈保护设置而拒绝收费。我们建议您首先联系您的银行,检查他们是否阻止了我们的收费。此外,您可以访问账单门户并更改关联的卡片以进行付款。如果这些方法不起作用并且您需要进一步帮助,请通过 [email protected]
价格由月度或年度订阅决定,具体取决于所选计划。
API 调用根据成功请求从您的计划中扣除。每个计划都包含您每月可以进行的特定数量的调用。只有成功的调用(由状态 200 响应指示)才会计入您的总数。这确保失败或不完整的请求不会影响您的月度配额。
Zyla API Hub 采用月度订阅系统。您的计费周期将从您购买付费计划的那一天开始,并在下个月的同一日期续订。因此,如果您想避免未来的费用,请提前取消订阅。
要升级您当前的订阅计划,只需转到 API 的定价页面并选择您要升级到的计划。升级将立即生效,让您立即享受新计划的功能。请注意,您之前计划中的任何剩余调用都不会转移到新计划,因此在升级时请注意这一点。您将被收取新计划的全部金额。
要检查您本月剩余多少 API 调用,请参考响应标头中的 "X-Zyla-API-Calls-Monthly-Remaining" 字段。例如,如果您的计划允许每月 1,000 个请求,而您已使用 100 个,则响应标头中的此字段将显示 900 个剩余调用。
要查看您的计划允许的最大 API 请求数,请检查 "X-Zyla-RateLimit-Limit" 响应标头。例如,如果您的计划包括每月 1,000 个请求,此标头将显示 1,000。
"X-Zyla-RateLimit-Reset" 标头显示您的速率限制重置之前的秒数。这告诉您何时您的请求计数将重新开始。例如,如果它显示 3,600,则意味着还有 3,600 秒直到限制重置。
是的,您可以随时通过访问您的账户并在账单页面上选择取消选项来取消您的计划。请注意,升级、降级和取消会立即生效。此外,取消后,您将不再有权访问该服务,即使您的配额中还有剩余调用。
为了让您有机会在没有任何承诺的情况下体验我们的 API,我们提供 7 天免费试用,允许您免费进行最多 50 次 API 调用。此试用只能使用一次,因此我们建议将其应用于您最感兴趣的 API。虽然我们的大多数 API 都提供免费试用,但有些可能不提供。试用在 7 天后或您进行了 50 次请求后结束,以先发生者为准。如果您在试用期间达到 50 次请求限制,您需要"开始您的付费计划"以继续发出请求。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。或者,如果您在第 7 天之前不取消订阅,您的免费试用将结束,您的计划将自动计费,授予您访问计划中指定的所有 API 调用的权限。请记住这一点以避免不必要的费用。
7 天后,您将被收取试用期间订阅的计划的全额费用。因此,在试用期结束前取消很重要。因忘记及时取消而提出的退款请求不被接受。
当您订阅 API 免费试用时,您可以进行最多 50 次 API 调用。如果您希望超出此限制进行额外的 API 调用,API 将提示您执行"开始您的付费计划"。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。
付款订单在每月 20 日至 30 日之间处理。如果您在 20 日之前提交请求,您的付款将在此时间范围内处理。
您可以通过我们的聊天渠道联系我们以获得即时帮助。我们始终在线,时间为上午 8 点至下午 5 点(EST)。如果您在该时间之后联系我们,我们将尽快回复您。此外,您可以通过 [email protected]

相关 API


您可能还喜欢