DevTools now provides an HTTP API server that allows other AI agents or applications to call all tool functions through RESTful APIs.
The API server runs on port 5000 by default. You can configure it by modifying the App.config file:
<appSettings>
<add key="EnableApiServer" value="true"/>
<add key="ApiServerPort" value="5000"/>
</appSettings>GET /api/health
Check if the API server is running properly.
Example Response:
{
"success": true,
"data": {
"status": "healthy",
"timestamp": "2026-04-12T10:00:00.0000000Z",
"version": "1.0.0"
}
}POST /api/md5
Compute MD5 hash of a string.
Request Body:
{
"input": "hello world"
}Example Response:
{
"success": true,
"data": {
"input": "hello world",
"hash32Lower": "5eb63bbbe01eeed093cb22bb8f5acdc3",
"hash32Upper": "5EB63BBBE01EEED093CB22BB8F5ACDC3",
"hash16Lower": "3bbbe01eeed093cb",
"hash16Upper": "3BBBBE01EEED093CB"
}
}POST /api/json/format
Format a JSON string.
Request Body:
{
"json": "{\"name\":\"John\",\"age\":30}"
}Example Response:
{
"success": true,
"data": {
"input": "{\"name\":\"John\",\"age\":30}",
"formatted": "{\n \"name\": \"John\",\n \"age\": 30\n}",
"isValid": true
}
}POST /api/json/validate
Validate if a JSON string is valid.
Request Body:
{
"json": "{\"name\":\"John\",\"age\":30}"
}Example Response:
{
"success": true,
"data": {
"isValid": true
}
}POST /api/url/encode
Encode a string for URL usage.
Request Body:
{
"input": "Hello World!"
}Example Response:
{
"success": true,
"data": {
"input": "Hello World!",
"output": "Hello%20World!",
"operation": "encode"
}
}POST /api/url/decode
Decode a URL-encoded string.
Request Body:
{
"input": "Hello%20World!"
}Example Response:
{
"success": true,
"data": {
"input": "Hello%20World!",
"output": "Hello World!",
"operation": "decode"
}
}POST /api/escape
Escape special characters in a string.
Request Body:
{
"input": "Hello\nWorld"
}Example Response:
{
"success": true,
"data": {
"input": "Hello\nWorld",
"output": "Hello\\nWorld",
"operation": "escape"
}
}POST /api/unescape
Unescape a string.
Request Body:
{
"input": "Hello\\nWorld"
}Example Response:
{
"success": true,
"data": {
"input": "Hello\\nWorld",
"output": "Hello\nWorld",
"operation": "unescape"
}
}POST /api/base64/encode
Encode a string to Base64.
Request Body:
{
"input": "Hello World",
"includeDataUri": false,
"mimeType": "text/plain"
}Example Response:
{
"success": true,
"data": {
"input": "Hello World",
"output": "SGVsbG8gV29ybGQ=",
"operation": "encode",
"includeDataUri": false
}
}POST /api/base64/decode
Decode a Base64 string to original content.
Request Body:
{
"base64": "SGVsbG8gV29ybGQ="
}Example Response:
{
"success": true,
"data": {
"input": "SGVsbG8gV29ybGQ=",
"output": "Hello World",
"mimeType": null,
"imageWidth": 0,
"imageHeight": 0
}
}POST /api/qrcode
Generate a QR code image (Base64 encoded).
Request Body:
{
"text": "https://example.com",
"width": 300,
"height": 300
}Example Response:
{
"success": true,
"data": {
"input": "https://example.com",
"imageBase64": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAA...",
"format": "PNG",
"width": 300,
"height": 300
}
}POST /api/barcode
Generate a barcode image (Base64 encoded).
Request Body:
{
"text": "123456789",
"format": "CODE_128",
"width": 400,
"height": 120
}Example Response:
{
"success": true,
"data": {
"input": "123456789",
"imageBase64": "iVBORw0KGgoAAAANSUhEUgAAAZAAAABkCAYAAACoy2Z3AAA...",
"format": "CODE_128",
"width": 400,
"height": 120
}
}GET /api/barcode/formats
Get a list of all supported barcode formats.
Example Response:
{
"success": true,
"data": {
"formats": [
"CODE_128",
"CODE_39",
"CODE_93",
"CODABAR",
"EAN_8",
"EAN_13",
"UPC_A",
"UPC_E",
"ITF",
"DATA_MATRIX",
"PDF_417"
]
}
}All API endpoints return a unified error response format when an error occurs:
{
"success": false,
"message": "Error description",
"errorCode": "ERROR_CODE"
}INVALID_INPUT- Invalid or missing input parameterNOT_FOUND- API endpoint not foundINTERNAL_ERROR- Internal server errorHTTP_4xx- HTTP protocol errors
The API server has CORS enabled by default, allowing requests from any origin. You can modify this through configuration:
{
"EnableCors": true,
"AllowedOrigins": "https://example.com"
}import requests
# MD5 Hash
response = requests.post('http://localhost:5000/api/md5', json={
'input': 'hello world'
})
result = response.json()
print(result['data']['hash32Lower'])
# JSON Format
response = requests.post('http://localhost:5000/api/json/format', json={
'json': '{"name":"John","age":30}'
})
result = response.json()
print(result['data']['formatted'])
# Generate QR Code
response = requests.post('http://localhost:5000/api/qrcode', json={
'text': 'https://example.com',
'width': 300,
'height': 300
})
result = response.json()
# Save QR Code Image
import base64
image_data = base64.b64decode(result['data']['imageBase64'])
with open('qrcode.png', 'wb') as f:
f.write(image_data)// MD5 Hash
const response = await fetch('http://localhost:5000/api/md5', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ input: 'hello world' })
});
const result = await response.json();
console.log(result.data.hash32Lower);
// JSON Format
const response = await fetch('http://localhost:5000/api/json/format', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ json: '{"name":"John","age":30}' })
});
const result = await response.json();
console.log(result.data.formatted);# MD5 Hash
curl -X POST http://localhost:5000/api/md5 \
-H "Content-Type: application/json" \
-d '{"input":"hello world"}'
# JSON Format
curl -X POST http://localhost:5000/api/json/format \
-H "Content-Type: application/json" \
-d '{"json":"{\"name\":\"John\",\"age\":30}"}'
# Health Check
curl http://localhost:5000/api/health- The API server is only available when the application is running
- Default port is 5000, can be modified through configuration file
- All API endpoints require
Content-Type: application/jsonheader - Image-related APIs (QR Code, Barcode) return Base64-encoded PNG images
- API server supports CORS requests