FT

API Documentation

Integrate FormatTools.online developer tools into your applications with our comprehensive API. Free access, no authentication required.

API Overview

FormatTools.online provides a RESTful API that allows you to programmatically access our developer tools. All tools run client-side in your browser, ensuring fast performance and complete privacy.

Fast & Free

No rate limits, no authentication required. Use as much as you need.

Privacy First

All processing happens client-side. Your data never leaves your device.

Easy Integration

Simple REST endpoints with JSON responses. Works with any language.

Important Note

FormatTools.online tools are designed to run client-side in the browser. For server-side integration, we recommend using our open-source libraries or implementing the formatting logic directly in your application. All our tools are available as JavaScript functions that can be embedded in your projects.

Available Tools

JSON Formatter

Format, validate, and minify JSON data.

// JavaScript Example
import { formatJSON } from '@formattools/json-formatter';

const jsonString = '{"name":"John","age":30}';
const formatted = formatJSON(jsonString, { indent: 2 });
console.log(formatted);

CSV to JSON Converter

Convert CSV data to JSON format.

// JavaScript Example
import { csvToJson } from '@formattools/csv-converter';

const csv = 'name,age\nJohn,30\nJane,25';
const json = csvToJson(csv);
console.log(json);

HTML Beautifier

Format and beautify HTML code.

// JavaScript Example
import { beautifyHTML } from '@formattools/html-beautifier';

const html = '<div><p>Hello</p></div>';
const formatted = beautifyHTML(html, { indent: 2 });
console.log(formatted);

Color Converter

Convert between color formats (HEX, RGB, HSL).

// JavaScript Example
import { convertColor } from '@formattools/color-converter';

const hex = '#FF5733';
const rgb = convertColor(hex, 'rgb');
console.log(rgb); // rgb(255, 87, 51)

Integration Methods

1. Client-Side Integration

Embed our tools directly in your web application using JavaScript:

<script src="https://formattools.online/js/formattools.min.js"></script>
<script>
  const formatter = FormatTools.jsonFormatter;
  const result = formatter.format('{"name":"John"}');
  console.log(result);
</script>

2. NPM Package

Install our NPM packages for Node.js projects:

npm install @formattools/json-formatter
npm install @formattools/csv-converter
npm install @formattools/html-beautifier

3. CDN Integration

Use our CDN for quick integration:

<script src="https://cdn.formattools.online/v1/formattools.js"></script>

Usage Examples

React Example

import { formatJSON } from '@formattools/json-formatter';
import { useState } from 'react';

function JSONFormatter() {
  const [input, setInput] = useState('');
  const [output, setOutput] = useState('');

  const handleFormat = () => {
    try {
      const formatted = formatJSON(input, { indent: 2 });
      setOutput(formatted);
    } catch (error) {
      setOutput('Invalid JSON');
    }
  };

  return (
    <div>
      <textarea value={input} onChange={(e) => setInput(e.target.value)} />
      <button onClick={handleFormat}>Format</button>
      <pre>{output}</pre>
    </div>
  );
}

Node.js Example

const { formatJSON } = require('@formattools/json-formatter');

const jsonString = '{"name":"John","age":30}';
const formatted = formatJSON(jsonString, { indent: 2 });
console.log(formatted);

Best Practices

1. Error Handling

Always wrap API calls in try-catch blocks to handle errors gracefully.

2. Input Validation

Validate input data before processing to ensure optimal performance.

3. Caching

Cache formatted results when possible to improve performance.

4. Rate Limiting

While there are no server-side rate limits, implement client-side throttling for better user experience.

Support & Resources

Need help integrating our tools? Check out these resources:

  • Blog & Tutorials - Learn how to use our tools effectively
  • Contact Us - Get help with integration questions
  • GitHub Repository - View source code and contribute
  • Documentation - Comprehensive guides and examples

Ready to Get Started?

Start integrating FormatTools into your applications today. Free, fast, and privacy-focused.