QRCode
Generates QR codes from text or URLs.
MCP tool: generate_qrcode_url
GET /v1/qrcode
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | string | ✓ | Text or URL to encode |
| size | integer | - | Image size in px (75–1000, default 300) |
| format | string | - | Output format (png / svg, default png) |
Request example:
curl "https://api.thousand-api.com/v1/qrcode?data=https://example.com&size=300" \
-H "x-api-key: YOUR_API_KEY"Response:
Returns PNG image or SVG data as binary.
Image Transform
Fetches an image from an HTTPS URL and converts, resizes, and/or compresses it to WebP, JPEG, PNG, or AVIF. Returns Base64-encoded data. Requests to private IP addresses are blocked (SSRF protection).
MCP tool: transform_image
POST /v1/image/transform
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | ✓ | HTTPS URL of the source image |
| format | string | - | Output format: webp / jpeg / png / avif (default: webp) |
| width | integer | - | Target width in px (1–4000) |
| height | integer | - | Target height in px (1–4000) |
| quality | integer | - | Compression quality 1–100 (webp/jpeg/avif, default 80; ignored for png) |
| fit | string | - | Resize fit: cover / contain / fill / inside / outside (default: inside) |
Response fields
| Parameter | Type | Description |
|---|---|---|
| format | string | Output format |
| width | number | Output width (px) |
| height | number | Output height (px) |
| original_size | number | Source size in bytes |
| converted_size | number | Output size in bytes |
| reduction_rate | number | Size reduction ratio (0.6 = 60% smaller) |
| data | string | Base64-encoded image data |
| mime_type | string | MIME type (e.g. image/webp) |
WebP conversion only
Request example:
curl -X POST "https://api.thousand-api.com/v1/image/transform" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/photo.png"
}'Response example:
{
"format": "webp",
"width": 1200,
"height": 800,
"original_size": 245760,
"converted_size": 98304,
"reduction_rate": 0.6,
"data": "UklGRi4AAABXRUJQVlA4...",
"mime_type": "image/webp"
}Resize + JPEG + quality
Request example:
curl -X POST "https://api.thousand-api.com/v1/image/transform" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/photo.png",
"format": "jpeg",
"width": 800,
"height": 600,
"quality": 85,
"fit": "cover"
}'Response example:
{
"format": "jpeg",
"width": 800,
"height": 600,
"original_size": 245760,
"converted_size": 112640,
"reduction_rate": 0.5417,
"data": "/9j/4AAQSkZJRg...",
"mime_type": "image/jpeg"
}fit parameter
| Parameter | Description |
|---|---|
| cover | Crop to cover the target box (preserve aspect ratio) |
| contain | Fit entirely inside the target box |
| fill | Stretch to exact width and height (ignore aspect ratio) |
| inside | Fit inside the box without enlarging (default) |
| outside | Minimum size that covers the box without enlarging |
Embed in HTML/CSS as data:image/webp;base64,{data}.
Markdown Convert
Converts Markdown text to HTML. GitHub Flavored Markdown (GFM) supported with optional XSS sanitization.
MCP tool: convert_markdown
POST /v1/convert/markdown
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| markdown | string | ✓ | Markdown text to convert (max 100KB) |
| sanitize | boolean | - | Sanitize HTML output (default true) |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/markdown" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello\n\nThis is **bold** text.",
"sanitize": true
}'Response example:
{
"html": "<h1>Hello</h1>\n<p>This is <strong>bold</strong> text.</p>"
}Response fields:
| Parameter | Description |
|---|---|
| html | Converted HTML string |
Response:
Supports GFM (tables, task lists, strikethrough, fenced code blocks). Use sanitize: false only for trusted Markdown on the server side; for user input, keep sanitize: true (default).
Unit Conversion
Converts values between units for length, mass, temperature, area, volume, speed, and data sizes. No external APIs; accurate math via mathjs.
MCP tool: convert_unit
Categories: length (m, km, mile, foot, inch, etc.), mass (kg, g, lb, oz, etc.), temperature (celsius, fahrenheit, kelvin), area (m2, ha, acre, sqft, etc.), volume (l, ml, gallon, cup, etc.), speed (m/s, km/h, mph, knot, etc.), data (byte, KB, MB, GB, TB, KiB, MiB, etc.)
GET /v1/unit/convert
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | number | ✓ | Value to convert |
| from | string | ✓ | Source unit |
| to | string | ✓ | Target unit |
Request example:
curl "https://api.thousand-api.com/v1/unit/convert?value=1&from=km&to=mile" \
-H "x-api-key: YOUR_API_KEY"Response example:
{
"value": 1,
"from": "km",
"to": "mile",
"result": 0.621371,
"formula": "1 km = 0.621371 mile"
}Base64 Encode/Decode
Encode or decode Base64 strings. Supports URL-safe variant and utf8/hex/base64 input encodings on encode. Uses Node.js Buffer only with no external dependencies.
MCP tool: convert_base64
When url_safe is true, encode replaces + with - and / with _ and strips trailing = padding. Decode reverses those substitutions and restores padding before decoding. Useful for JWT payload segments and other URL-safe Base64 data.
POST /v1/encode/base64
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | string | ✓ | String to encode or decode (max 512KB) |
| direction | string | ✓ | encode / decode |
| url_safe | boolean | - | Use URL-safe Base64 (default: false) |
| input_encoding | string | - | Input encoding when direction is encode: utf8 / hex / base64 (default: utf8) |
Response fields:
| Parameter | Type | Description |
|---|---|---|
| direction | string | Processing direction (encode / decode) |
| input | string | Original request data value |
| output | string | Encoded or decoded result |
| url_safe | boolean | Whether URL-safe Base64 was used |
| byte_length | number | Byte length of input (Buffer.byteLength) |
Encode example:
Request example:
curl -X POST "https://api.thousand-api.com/v1/encode/base64" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": "Hello, world!",
"direction": "encode"
}'Response example:
{
"direction": "encode",
"input": "Hello, world!",
"output": "SGVsbG8sIHdvcmxkIQ==",
"url_safe": false,
"byte_length": 13
}Decode example:
Request example:
curl -X POST "https://api.thousand-api.com/v1/encode/base64" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": "SGVsbG8sIHdvcmxkIQ==",
"direction": "decode"
}'Response example:
{
"direction": "decode",
"input": "SGVsbG8sIHdvcmxkIQ==",
"output": "Hello, world!",
"url_safe": false,
"byte_length": 20
}CSV ↔ JSON Conversion
Convert between CSV and JSON. Supports header rows and custom delimiters.
MCP tool: convert_csv
Tab-separated values (TSV) are supported by setting delimiter to "\t".
POST /v1/convert/csv
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| input | string | ✓ | Data to convert (max 1MB) |
| from | string | ✓ | csv / json |
| to | string | ✓ | csv / json |
| has_header | boolean | - | Whether the first CSV row is a header (default: true) |
| delimiter | string | - | CSV field delimiter (default: comma) |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/csv" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "name,age\nAlice,30\nBob,25",
"from": "csv",
"to": "json"
}'Response example:
{
"from": "csv",
"to": "json",
"result": [
{ "name": "Alice", "age": "30" },
{ "name": "Bob", "age": "25" }
],
"rows": 2,
"columns": 2
}YAML ↔ JSON Conversion
Convert between YAML and JSON. Control JSON output indentation with the indent parameter.
MCP tool: convert_yaml
POST /v1/convert/yaml
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| input | string | ✓ | Data to convert (max 1MB) |
| from | string | ✓ | yaml / json |
| to | string | ✓ | yaml / json |
| indent | integer | - | JSON output indentation (0–10, default 2) |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/yaml" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "name: Alice\nage: 30",
"from": "yaml",
"to": "json",
"indent": 2
}'Response example:
{
"from": "yaml",
"to": "json",
"result": "{\n \"name\": \"Alice\",\n \"age\": 30\n}",
"indent": 2
}TOML ↔ JSON Conversion
Convert between TOML and JSON. Useful for pyproject.toml, Cargo.toml, and other config files. Supports nested tables ([section]) and table arrays ([[...]]).
MCP tool: convert_toml
POST /v1/convert/toml — direction: to_json
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| input | string | ✓ | TOML string to convert (max 1MB) |
| direction | string | ✓ | to_json |
| indent | integer | - | JSON indentation width (0–8, default 2) |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/toml" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "[package]\nname = \"my-crate\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = \"1.0\"",
"direction": "to_json",
"indent": 2
}'Response example:
{
"direction": "to_json",
"output": {
"package": { "name": "my-crate", "version": "0.1.0" },
"dependencies": { "serde": "1.0" }
},
"output_str": "{\n \"package\": { \"name\": \"my-crate\", \"version\": \"0.1.0\" },\n \"dependencies\": { \"serde\": \"1.0\" }\n}",
"byte_length": 98
}POST /v1/convert/toml — direction: to_toml
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| input | string | ✓ | JSON string to convert (max 1MB) |
| direction | string | ✓ | to_toml |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/toml" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "{\"title\":\"Thousand API\",\"version\":\"1.0.0\"}",
"direction": "to_toml"
}'Response example:
{
"direction": "to_toml",
"output": "title = \"Thousand API\"\nversion = \"1.0.0\"",
"output_str": "title = \"Thousand API\"\nversion = \"1.0.0\"",
"byte_length": 42
}Response fields
| Parameter | Type | Description |
|---|---|---|
| direction | string | Conversion direction used (to_json / to_toml) |
| output | any | Parsed JSON object when to_json; TOML string when to_toml |
| output_str | string | JSON.stringify result when to_json; TOML text when to_toml (same as output for to_toml) |
| byte_length | number | UTF-8 byte length of output_str |
XML ↔ JSON Conversion
Convert between XML and JSON. Useful for legacy API responses, AWS/GCP configs, SOAP payloads, RSS feeds, and other XML data. Attributes are represented with a configurable prefix (default @).
MCP tool: convert_xml
XML attributes become JSON keys with attribute_prefix (default @). Example: <user id="1"> → { "user": { "@id": 1 } }. For to_xml, use the same prefix in JSON (e.g. "@id") to emit XML attributes.
POST /v1/convert/xml — direction: to_json
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| input | string | ✓ | XML string to convert (max 1MB) |
| direction | string | ✓ | to_json |
| indent | integer | - | JSON output indentation (0–8, default 2) |
| attribute_prefix | string | - | Prefix for attribute keys (default @) |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/xml" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "<user id=\"1\"><name>Alice</name></user>",
"direction": "to_json",
"indent": 2
}'Response example:
{
"direction": "to_json",
"output": {
"user": { "@id": 1, "name": "Alice" }
},
"output_str": "{\n \"user\": {\n \"@id\": 1,\n \"name\": \"Alice\"\n }\n}",
"byte_length": 52
}POST /v1/convert/xml — direction: to_xml
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| input | string | ✓ | JSON string to convert (max 1MB) |
| direction | string | ✓ | to_xml |
| indent | integer | - | XML output indentation (0–8, default 2) |
| attribute_prefix | string | - | Prefix for attribute keys (default @) |
Request example:
curl -X POST "https://api.thousand-api.com/v1/convert/xml" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "{\"user\":{\"@id\":1,\"name\":\"Alice\"}}",
"direction": "to_xml",
"indent": 2
}'Response example:
{
"direction": "to_xml",
"output": "<user id=\"1\">\n <name>Alice</name>\n</user>",
"output_str": "<user id=\"1\">\n <name>Alice</name>\n</user>",
"byte_length": 42
}Response fields
| Parameter | Type | Description |
|---|---|---|
| direction | string | Conversion direction used (to_json / to_xml) |
| output | any | Parsed JSON object when to_json; XML string when to_xml |
| output_str | string | Formatted JSON string when to_json; XML string when to_xml (same as output for to_xml) |
| byte_length | number | UTF-8 byte length of output_str |
Number & Currency Formatting
Formats numbers for a locale. Supports currency, percent, and unit display using Node.js Intl.NumberFormat.
MCP tool: format_number
GET /v1/format/number
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | number | ✓ | Number to format |
| locale | string | - | Locale (default: en-US) |
| style | string | - | decimal / currency / percent / unit |
| currency | string | - | Currency code (required when style=currency) |
| unit | string | - | Unit (required when style=unit) |
| minimum_fraction_digits | integer | - | Minimum fraction digits (0–20) |
| maximum_fraction_digits | integer | - | Maximum fraction digits (0–20) |
Request example:
curl "https://api.thousand-api.com/v1/format/number?value=1234567.89&locale=ja-JP&style=currency¤cy=JPY" \
-H "x-api-key: YOUR_API_KEY"Response example:
{
"value": 1234567.89,
"locale": "ja-JP",
"style": "currency",
"currency": "JPY",
"formatted": "¥1,234,568"
}