API DOCUMENTATION
Developer guide for integrating Feverdream Tools into your applications
All tools run client-side • No server uploads • Privacy focused
Getting Started
Feverdream Tools provides a comprehensive API that allows developers to integrate our utilities directly into their applications. All processing is done client-side in the browser, ensuring user privacy and data security.
API Endpoint
All API requests should be sent to: https://tools.feverdream.pw/api/
Rate Limiting
To ensure fair usage and prevent server overload, we implement rate limiting:
- Maximum 30 requests per minute per IP address
- Requests exceeding this limit will receive a 429 status code
- Implement exponential backoff in your applications
Response Format
All API responses are returned in JSON format:
{
"success": true,
"message": "Operation completed successfully",
"data": {
// Tool-specific data
}
}
Available Tools
YouTube Downloader
Download YouTube videos and audio in various qualities
Endpoint
POST /api/youtube-download.php
Parameters
- url (string, required): The YouTube video URL
- type (string, optional): Download type - "video" or "audio" (default: "video")
- quality (string, optional): Preferred quality - "best", "1080p", "720p", "480p", "360p" (default: "best")
Response
{
"success": true,
"message": "Download completed successfully!",
"downloadUrl": "../temp/downloads/VIDEO_ID_TIMESTAMP_RANDOM.mp4",
"filename": "VIDEO_ID_TIMESTAMP_RANDOM.mp4"
}
Example Usage
fetch('/api/youtube-download.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://www.youtube.com/watch?v=example',
type: 'video',
quality: '1080p'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Provide download link to user
window.location.href = data.downloadUrl;
} else {
// Handle error
console.error(data.message);
}
});
Text Utilities
Collection of text processing tools
Endpoints
POST /api/text-generate.php- Generate various types of textPOST /api/text-convert.php- Convert text between formatsPOST /api/text-filter.php- Filter text based on various criteria
Text Generation Parameters
- type (string, required): Generation type - "lorem", "password", "uuid", "timestamp", "random", "sequence"
- count (integer, optional): Number of items to generate (default: 1)
- length (integer, optional): Length of generated text (for password/random)
- format (string, optional): Output format - "text" or "json" (default: "text")
Text Conversion Parameters
- type (string, required): Conversion type - "base", "unit", "temperature", "encoding"
- text (string, required): Text to convert
- from (string, optional): Source format (required for unit/temperature)
- to (string, optional): Target format (required for unit/temperature)
Text Filtering Parameters
- text (string, required): Text to filter
- filterType (string, required): Type of filter - "whitelist", "blacklist", "unique", "duplicates", "empty", "length", "pattern", "sort"
- characters (string, optional): Characters for whitelist/blacklist
- minLength (integer, optional): Minimum line length
- maxLength (integer, optional): Maximum line length
- pattern (string, optional): Regex pattern for pattern filtering
Text Generation Parameters
- type (string, required): Generation type - "lorem", "password", "uuid", "timestamp", "random", "sequence"
- count (integer, optional): Number of items to generate (default: 1)
- length (integer, optional): Length of generated text (for password/random)
- format (string, optional): Output format - "text" or "json" (default: "text")
Text Conversion Parameters
- type (string, required): Conversion type - "base", "unit", "temperature", "encoding"
- text (string, required): Text to convert
- from (string, optional): Source format (required for unit/temperature)
- to (string, optional): Target format (required for unit/temperature)
Text Filtering Parameters
- text (string, required): Text to filter
- filterType (string, required): Type of filter - "whitelist", "blacklist", "unique", "duplicates", "empty", "length", "pattern", "sort"
- characters (string, optional): Characters for whitelist/blacklist
- minLength (integer, optional): Minimum line length
- maxLength (integer, optional): Maximum line length
- pattern (string, optional): Regex pattern for pattern filtering
File Processing
Client-side file processing utilities
Endpoints
POST /api/file-merge.php- Merge multiple filesPOST /api/file-split.php- Split files by size or line countPOST /api/base64-encode.php- Encode files to Base64POST /api/base64-decode.php- Decode Base64 to filesPOST /api/qr-generate.php- Generate QR codesPOST /api/color-picker.php- Color conversion and palette generationPOST /api/timestamp-convert.php- Timestamp conversionPOST /api/text-case.php- Text case conversionPOST /api/text-reverse.php- Text reversingPOST /api/text-sort.php- Text sortingPOST /api/text-count.php- Text countingPOST /api/text-trim.php- Text trimmingPOST /api/text-replace.php- Text replacementPOST /api/text-extract.php- Text extractionPOST /api/text-format.php- Text formattingPOST /api/text-analyze.php- Text analysisPOST /api/text-compare.php- Text comparisonPOST /api/text-validate.php- Text validationPOST /api/text-encrypt.php- Text encryption/decryptionPOST /api/text-compress.php- Text compression/decompressionPOST /api/text-summarize.php- Text summarizationPOST /api/text-translate.php- Text translation
File Merge Parameters
- files (array, required): Array of file data
- delimiter (string, optional): Delimiter between files (default: newline)
File Split Parameters
- file (string, required): File data to split
- method (string, required): Split method - "size" or "lines"
- value (integer, required): Size in bytes or number of lines per split
File Merge Parameters
- files (array, required): Array of file data
- delimiter (string, optional): Delimiter between files (default: newline)
File Split Parameters
- file (string, required): File data to split
- method (string, required): Split method - "size" or "lines"
- value (integer, required): Size in bytes or number of lines per split
Hash Generation
Generate cryptographic hashes for text or files
Endpoint
POST /api/hash-generate.php
Parameters
- text (string, required): Text to hash (omit if using file)
- file (file, required): File to hash (omit if using text)
- algorithm (string, required): Hash algorithm - "md5", "sha1", "sha256"
Response
{
"success": true,
"message": "Hash generated successfully",
"data": {
"hash": "5d41402abc4b2a76b9719d911017c592",
"algorithm": "md5"
}
}
Response
{
"success": true,
"message": "Hash generated successfully",
"data": {
"hash": "5d41402abc4b2a76b9719d911017c592",
"algorithm": "md5"
}
}
Text Translator
Translate text between different languages
Endpoint
POST /api/text-translate.php
Parameters
- text (string, required): Text to translate
- target_language (string, required): Target language code (e.g., "es", "fr", "de")
- source_language (string, optional): Source language code (e.g., "en", "es", "fr") or "auto" for auto-detection (default: "auto")
Response
{
"success": true,
"message": "Text translated successfully",
"data": {
"original": "Hello World",
"translated": "Hola Mundo",
"source_language": "en",
"target_language": "es",
"source_language_name": "English",
"target_language_name": "Spanish"
}
}
Example Usage
fetch('/api/text-translate.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World',
target_language: 'es'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use translated text
console.log(data.data.translated); // Hola Mundo
} else {
// Handle error
console.error(data.message);
}
});
Text Summarizer
Create a summary of text content using various methods
Endpoint
POST /api/text-summarize.php
Parameters
- text (string, required): Text to summarize
- method (string, optional): Summarization method - "simple" or "keywords" (default: "simple")
- length (integer, optional): Number of sentences/keywords to include (default: 3)
Response
{
"success": true,
"message": "Text summarized successfully",
"data": {
"original": "This is the first sentence. This is the second sentence. This is the third sentence. This is the fourth sentence.",
"summarized": "This is the first sentence. This is the second sentence. This is the third sentence.",
"method": "simple",
"length": 3
}
}
Example Usage
fetch('/api/text-summarize.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'This is a sample text. It contains multiple sentences. This is a summary tool. It helps extract key information.',
method: 'simple',
length: 2
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use summarized text
console.log(data.data.summarized);
} else {
// Handle error
console.error(data.message);
}
});
Text Compressor
Compress or decompress text using various compression methods
Endpoint
POST /api/text-compress.php
Parameters
- text (string, required): Text to compress/decompress
- action (string, required): Action to perform - "compress" or "decompress"
- method (string, optional): Compression method - "gzip" or "deflate" (default: "gzip")
Response
{
"success": true,
"message": "Text processed successfully",
"data": {
"original": "Hello World This is a sample text for compression",
"processed": "H4sIAAAAAAAAA/NIzcnJVwjPL8pJUQguSSzJzFNILC5OLS7JzM9TSMsvyU3KTM9TSC4tKkrMS87PzU3My8xLVQgoyk8vSi0uBgD7YF65HQAAAA==",
"action": "compress",
"method": "gzip"
}
}
Example Usage
fetch('/api/text-compress.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World This is a sample text for compression',
action: 'compress',
method: 'gzip'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use compressed text
console.log(data.data.processed);
} else {
// Handle error
console.error(data.message);
}
});
Text Encryptor
Encrypt or decrypt text using various methods
Endpoint
POST /api/text-encrypt.php
Parameters
- text (string, required): Text to encrypt/decrypt
- action (string, required): Action to perform - "encrypt" or "decrypt"
- method (string, required): Encryption method - "base64", "rot13", or "caesar"
- key (string, optional): Key for encryption methods that require it (e.g., Caesar cipher)
Response
{
"success": true,
"message": "Text processed successfully",
"data": {
"original": "Hello World",
"processed": "Uryyb Jbeyq",
"action": "encrypt",
"method": "rot13"
}
}
Example Usage
fetch('/api/text-encrypt.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World',
action: 'encrypt',
method: 'rot13'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use encrypted text
console.log(data.data.processed); // Uryyb Jbeyq
} else {
// Handle error
console.error(data.message);
}
});
Text Validator
Validate text formats including email, URL, IP, regex, JSON, and length
Endpoint
POST /api/text-validate.php
Parameters
- text (string, required): Text to validate
- validation_type (string, required): Validation type - "email", "url", "ip", "regex", "json", or "length"
Regex Parameters
- pattern (string, required): Regular expression pattern
Length Parameters
- min (integer, optional): Minimum length (default: 0)
- max (integer, optional): Maximum length (default: PHP_INT_MAX)
Response
{
"success": true,
"message": "Text validated successfully",
"data": {
"text": "user@example.com",
"validation_type": "email",
"is_valid": true
}
}
Example Usage
fetch('/api/text-validate.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'user@example.com',
validation_type: 'email'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use validation result
console.log('Email is valid:', data.data.is_valid); // true
} else {
// Handle error
console.error(data.message);
}
});
Text Comparator
Compare two texts for equality or similarity
Endpoint
POST /api/text-compare.php
Parameters
- text1 (string, required): First text to compare
- text2 (string, required): Second text to compare
- type (string, optional): Comparison type - "basic", "case_insensitive", "whitespace_ignored", or "similarity" (default: "basic")
Response
{
"success": true,
"message": "Texts compared successfully",
"data": {
"text1": "Hello World",
"text2": "hello world",
"are_equal": false,
"length1": 11,
"length2": 11,
"type": "basic"
}
}
Example Usage
fetch('/api/text-compare.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text1: 'Hello World',
text2: 'hello world',
type: 'case_insensitive'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use comparison result
console.log('Texts are equal:', data.data.are_equal); // true
} else {
// Handle error
console.error(data.message);
}
});
Text Analyzer
Analyze text for word count, character count, line count, and character frequency
Endpoint
POST /api/text-analyze.php
Parameters
- text (string, required): Text to analyze
- type (string, optional): Analysis type - "all", "words", "characters", or "lines" (default: "all")
Response
{
"success": true,
"message": "Text analyzed successfully",
"data": {
"original": "Hello World Example Text",
"word_count": 4,
"character_count": 23,
"character_count_no_spaces": 19,
"line_count": 1,
"character_frequency": {
"e": 4,
"l": 3,
"t": 3,
"x": 2,
"a": 2,
"m": 2,
"p": 2,
"h": 1,
"o": 1,
"w": 1,
"r": 1,
"d": 1,
"y": 1,
"g": 1
},
"type": "all"
}
}
Example Usage
fetch('/api/text-analyze.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World Example Text',
type: 'words'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use word analysis
console.log('Word count:', data.data.word_count); // 4
} else {
// Handle error
console.error(data.message);
}
});
Text Formatter
Format text in various ways including case changes and JSON formatting
Endpoint
POST /api/text-format.php
Parameters
- text (string, required): Text to format
- format (string, required): Format type - "uppercase", "lowercase", "capitalize", "title", "reverse", "trim", or "json"
Response
{
"success": true,
"message": "Text formatted successfully",
"data": {
"original": "hello world",
"formatted": "Hello World",
"format": "title"
}
}
Example Usage
fetch('/api/text-format.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'hello world',
format: 'title'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use formatted text
console.log(data.data.formatted); // Hello World
} else {
// Handle error
console.error(data.message);
}
});
Text Extractor
Extract parts of text using various methods
Endpoint
POST /api/text-extract.php
Parameters
- text (string, required): Text to extract from
- action (string, required): Extraction method - "substring", "regex", "first", or "last"
Substring Parameters
- start (integer, required): Start position
- end (integer, required): End position
Regex Parameters
- pattern (string, required): Regular expression pattern
First/Last Parameters
- length (integer, required): Number of characters to extract
Response
{
"success": true,
"message": "Text extracted successfully",
"data": {
"original": "Hello World Example Text",
"extracted": "Hello",
"action": "first"
}
}
Example Usage
fetch('/api/text-extract.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World Example Text',
action: 'first',
length: 5
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use extracted text
console.log(data.data.extracted); // Hello
} else {
// Handle error
console.error(data.message);
}
});
Text Replacer
Replace text patterns with new text
Endpoint
POST /api/text-replace.php
Parameters
- text (string, required): Text to modify
- search (string, required): Text pattern to search for
- replace (string, required): Replacement text
- count (integer, optional): Maximum number of replacements (-1 for all, default: -1)
Response
{
"success": true,
"message": "Text replaced successfully",
"data": {
"original": "Hello World Hello Universe",
"modified": "Hi World Hi Universe",
"search": "Hello",
"replace": "Hi",
"count": -1
}
}
Example Usage
fetch('/api/text-replace.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World Hello Universe',
search: 'Hello',
replace: 'Hi',
count: 1
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use modified text
console.log(data.data.modified); // Hi World Hello Universe
} else {
// Handle error
console.error(data.message);
}
});
Text Trimmer
Trim whitespace from text
Endpoint
POST /api/text-trim.php
Parameters
- text (string, required): Text to trim
- type (string, optional): Trim type - "left", "right", or "both" (default: "both")
Response
{
"success": true,
"message": "Text trimmed successfully",
"data": {
"original": " Hello World ",
"trimmed": "Hello World",
"type": "both"
}
}
Example Usage
fetch('/api/text-trim.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: ' Hello World ',
type: 'both'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use trimmed text
console.log(data.data.trimmed); // Hello World
} else {
// Handle error
console.error(data.message);
}
});
Text Counter
Count characters, words, lines, sentences, and paragraphs in text
Endpoint
POST /api/text-count.php
Parameters
- text (string, required): Text to count
- type (string, optional): Count type - "all", "characters", "words", "lines", "sentences", or "paragraphs" (default: "all")
Response
{
"success": true,
"message": "Text counted successfully",
"data": {
"text": "Hello world. This is a sample text!",
"counts": {
"characters": 37,
"words": 8,
"lines": 1,
"sentences": 2,
"paragraphs": 1
},
"type": "all"
}
}
Example Usage
fetch('/api/text-count.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello world. This is a sample text!',
type: 'words'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use word count
console.log('Word count:', data.data.counts.words); // 8
} else {
// Handle error
console.error(data.message);
}
});
Text Sorter
Sort text lines or words in ascending or descending order
Endpoint
POST /api/text-sort.php
Parameters
- text (string, required): Text to sort
- order (string, optional): Sort order - "asc" or "desc" (default: "asc")
- type (string, optional): Sort type - "lines" or "words" (default: "lines")
Response
{
"success": true,
"message": "Text sorted successfully",
"data": {
"original": "zebra\napple\norange",
"sorted": "apple\norange\nzebra",
"order": "asc",
"type": "lines"
}
}
Example Usage
fetch('/api/text-sort.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'zebra apple orange',
order: 'asc',
type: 'words'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use sorted text
console.log(data.data.sorted); // apple orange zebra
} else {
// Handle error
console.error(data.message);
}
});
Text Reverser
Reverse text characters or words
Endpoint
POST /api/text-reverse.php
Parameters
- text (string, required): Text to reverse
- type (string, optional): Reverse type - "characters" or "words" (default: "characters")
Response
{
"success": true,
"message": "Text reversed successfully",
"data": {
"original": "Hello World",
"reversed": "dlroW olleH",
"type": "characters"
}
}
Example Usage
fetch('/api/text-reverse.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World Example',
type: 'words'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use reversed text
console.log(data.data.reversed); // Example World Hello
} else {
// Handle error
console.error(data.message);
}
});
Text Case Converter
Convert text between different case formats
Endpoint
POST /api/text-case.php
Parameters
- text (string, required): Text to convert
- case (string, required): Case format to convert to - "upper", "lower", "title", "sentence", "camel", "pascal", "snake", or "kebab"
Response
{
"success": true,
"message": "Text case converted successfully",
"data": {
"original": "Hello World",
"converted": "hello world",
"case": "lower"
}
}
Example Usage
fetch('/api/text-case.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Hello World Example',
case: 'snake'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use converted text
console.log(data.data.converted); // hello_world_example
} else {
// Handle error
console.error(data.message);
}
});
Timestamp Converter
Convert between Unix timestamps and human-readable dates
Endpoint
POST /api/timestamp-convert.php
Parameters
- timestamp (string/integer, required): Unix timestamp or human-readable date to convert
- format (string, optional): Output format - "both", "human", or "unix" (default: "both")
Response
{
"success": true,
"message": "Timestamp converted successfully",
"data": {
"human": "2023-12-25 15:30:45",
"unix": 1703517045
}
}
Example Usage
fetch('/api/timestamp-convert.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
timestamp: '2023-12-25 15:30:45',
format: 'both'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use converted timestamps
console.log('Human readable:', data.data.human);
console.log('Unix timestamp:', data.data.unix);
} else {
// Handle error
console.error(data.message);
}
});
Color Picker
Convert between color formats and generate color palettes
Endpoint
POST /api/color-picker.php
Parameters
- action (string, required): Action to perform - "convert" or "generate"
Color Conversion Parameters
- from (string, required): Source color format - "hex", "rgb", "hsl"
- to (string, required): Target color format - "hex", "rgb", "hsl"
- value (string, required): Color value to convert
Color Palette Generation Parameters
- type (string, optional): Palette type - "random", "complementary", "analogous" (default: "random")
- count (integer, optional): Number of colors to generate (default: 5)
Response
{
"success": true,
"message": "Color converted successfully",
"data": {
"input": "#ff0000",
"output": "rgb(255, 0, 0)",
"from": "hex",
"to": "rgb"
}
}
Example Usage
fetch('/api/color-picker.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'convert',
from: 'hex',
to: 'rgb',
value: '#ff0000'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Use converted color
console.log(data.data.output);
} else {
// Handle error
console.error(data.message);
}
});
Endpoint
POST /api/qr-generate.php
Parameters
- text (string, required): Text to encode in QR code
- size (integer, optional): Size of QR code in pixels (100-1000, default: 300)
Response
{
"success": true,
"message": "QR code generated successfully",
"data": {
"qrCode": "data:image/png;base64,...",
"text": "Text that was encoded",
"size": 300
}
}
Example Usage
fetch('/api/qr-generate.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'https://example.com',
size: 300
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Display QR code
const img = document.createElement('img');
img.src = data.data.qrCode;
document.body.appendChild(img);
} else {
// Handle error
console.error(data.message);
}
});
Unit Conversion
Convert between various units of measurement
Endpoint
POST /api/unit-convert.php
Parameters
- value (number, required): Value to convert
- from (string, required): Source unit
- to (string, required): Target unit
- category (string, required): Unit category - "length", "weight", "volume", "temperature"
Response
{
"success": true,
"message": "Conversion completed successfully",
"data": {
"input": "10 meters",
"output": "32.8084 feet"
}
}
Response
{
"success": true,
"message": "Conversion completed successfully",
"data": {
"input": "10 meters",
"output": "32.8084 feet"
}
}
Important Notes
- All processing is done client-side in the browser
- No data is sent to or stored on our servers
- Files are temporarily cached for 5 minutes before automatic deletion
- Rate limiting is enforced to prevent server overload
- API endpoints return appropriate HTTP status codes for errors
- For file operations, files are processed in memory and never saved to disk