← Back to JSON Formatter

JSON Formatter - Help Documentation

Complete guide to using the JSON Formatter and integration options

Table of Contents

Project Overview

The BizFirstAI JSON Formatter is a powerful, privacy-focused tool designed for developers and users who need to format, validate, and analyze JSON data. Our tool serves two primary purposes:

Primary Use Cases:

  1. Manual JSON Processing: Developers and users can input JSON data directly to format, validate, and analyze it using our intuitive interface.
  2. Application Integration: Any application can integrate with our tool by creating URLs that automatically process JSON data, making it perfect for embedding in websites or linking from other applications.

Basic Usage

Available Actions

  • Format: Pretty-print JSON with proper indentation (default action)
  • Beautify: Same as format, provided for compatibility
  • Minify: Remove all unnecessary whitespace to compress JSON
  • Validate: Check JSON syntax and provide detailed error messages

Manual Usage

  1. Paste your JSON data into the input textarea
  2. Click the desired action button (Format, Minify, Validate, or Clear)
  3. View the results in the output section
  4. Copy the formatted result using the "Copy to Clipboard" button

URL Parameter Integration

The JSON Formatter supports automatic processing via URL parameters, making it perfect for integration with other applications.

URL Format

https://yoursite.com/index.html?inputJson=[URL_ENCODED_JSON]&actionType=[ACTION]

Parameters

  • inputJson: URL-encoded JSON string to process (required)
  • actionType: Action to perform (optional, defaults to "format")
    • format - Pretty-print with indentation (default)
    • beautify - Same as format
    • minify - Remove whitespace
    • validate - Validate syntax only

Example URLs

# Format JSON automatically index.html?inputJson=%7B%22name%22%3A%22John%22%2C%22age%22%3A30%7D&actionType=format # Minify JSON index.html?inputJson=%7B%22name%22%3A%22John%22%2C%22age%22%3A30%7D&actionType=minify # Validate JSON index.html?inputJson=%7B%22name%22%3A%22John%22%2C%22age%22%3A30%7D&actionType=validate

Embedding in Your Website

You can embed the JSON Formatter directly into your website or web application using an iframe:

<iframe src="https://yoursite.com/index.html?inputJson=YOUR_ENCODED_JSON&actionType=format" width="100%" height="600" frameborder="0" style="border: 1px solid #ccc; border-radius: 8px;"> </iframe>
Pro Tip: When embedding, the JSON will be automatically processed and displayed when the iframe loads, providing a seamless user experience.

AI Integration Features

The JSON Formatter includes optional AI integration capabilities that can convert JSON data into natural language explanations based on your custom instructions.

How AI Integration Works

  1. Custom Instructions: You provide instructions on how the AI should interpret your JSON data
  2. AI Processing: The JSON is sent to your configured AI service (e.g., Gemini AI, OpenAI, etc.)
  3. Natural Language Output: Receive human-readable explanations of complex JSON structures

AI Integration Benefits:

  • Convert complex JSON into readable explanations
  • Custom interpretation based on your domain knowledge
  • Multiple AI provider support
  • Your own API keys and accounts for full control

Blockchain Transaction Validation

One of the most powerful use cases is validating blockchain transactions before submission. This feature is designed for maximum security and trust verification.

Use Case Example

Imagine you're using a blockchain wallet and need to send a complex financial transaction. Before signing and submitting to the blockchain, you can:

  1. Extract Transaction Data: Your wallet generates JSON representing the transaction
  2. Send to Validator: The JSON is sent to our formatter with custom validation instructions
  3. AI Analysis: Your trusted AI provider analyzes the transaction against your criteria
  4. Human-Readable Report: Get a clear explanation of what the transaction will do
  5. Verify & Proceed: Make an informed decision before signing

Trust and Security Model

Zero Trust Architecture: Your data is never sent to BizFirstAI servers or any third parties you don't explicitly choose. All processing happens through your own configured AI services.

Security Features:

  • Your data only goes to AI services you configure
  • Use your own API keys and accounts
  • No dependency on BizFirstAI for data processing
  • Client-side processing where possible
  • Support for fully managed or self-hosted solutions

Privacy & Security

Data Privacy

  • Client-Side Processing: Basic JSON formatting and validation happens entirely in your browser
  • No Data Storage: We don't store any of your JSON data on our servers
  • Your AI Services: When using AI features, data is sent only to AI providers you configure
  • Open Source: The code is transparent and auditable

Integration Options

  • Bring Your Own Keys: Use your own API keys for AI services
  • Self-Hosted: Deploy the entire solution on your own infrastructure
  • Managed Service: Optional managed integration for enterprise users

Integration Examples

JavaScript Integration

// Generate URL for JSON processing function formatJSONWithTool(jsonData, action = 'format') { const encodedJSON = encodeURIComponent(JSON.stringify(jsonData)); const url = `https://yoursite.com/index.html?inputJson=${encodedJSON}&actionType=${action}`; return url; } // Example usage const transactionData = { to: "0x1234567890123456789012345678901234567890", value: "1000000000000000000", gas: "21000" }; const validationURL = formatJSONWithTool(transactionData, 'validate'); window.open(validationURL, '_blank');

Python Integration

import urllib.parse import json def create_json_formatter_url(json_data, action='format', base_url='https://yoursite.com'): """Create URL for JSON formatter with data""" encoded_json = urllib.parse.quote(json.dumps(json_data)) url = f"{base_url}/index.html?inputJson={encoded_json}&actionType={action}" return url # Example usage transaction = { "to": "0x1234567890123456789012345678901234567890", "value": "1000000000000000000", "gas": "21000" } validation_url = create_json_formatter_url(transaction, 'validate') print(f"Validation URL: {validation_url}")

Developer API

URL Encoding Helper

When integrating, ensure your JSON is properly URL-encoded:

// JavaScript const encodedJSON = encodeURIComponent(JSON.stringify(yourJSONObject)); // Python import urllib.parse import json encoded_json = urllib.parse.quote(json.dumps(your_json_object)) // PHP $encodedJSON = urlencode(json_encode($yourJSONObject));

Supported MIME Types

  • application/json - Standard JSON content type
  • text/plain - Plain text JSON
  • application/x-www-form-urlencoded - Form-encoded JSON in URL parameters

Error Handling

The formatter provides detailed error messages for:

  • Invalid JSON syntax
  • Missing closing brackets or braces
  • Unexpected tokens
  • Position-specific error information
Need Help? If you need assistance with integration or have questions about AI features, contact our support team or check our GitHub repository for examples and community support.

Why BizFirstAI JSON Formatter is More Secure

Regular JSON formatters you see on the internet cannot be trustworthy for the following reasons:

Security Risks with Public JSON Formatters:

  1. Data Transmission to Unknown Servers: The data you send can be transmitted to their own servers and used for their own purposes
  2. Code Modification Risk: They can change the code and sneak in malicious functionality at any time
  3. Enterprise Security Concerns: Secured organizations like Walmart will never allow their programmers to paste company JSON on public websites
  4. No Control Over Data Processing: You have no visibility or control over how your sensitive data is handled

BizFirstAI's Decentralized Solution

Our solution provides a safe approach to resolve these privacy issues through decentralized deployment:

IPFS Integration Benefits:

  • Immutable Code: You can integrate the web page to an IPFS file that never changes its JavaScript code
  • No Proprietary Control: Once deployed on IPFS, the code cannot be modified by any company, including BizFirstAI
  • Decentralized Hosting: Your formatter runs independently without relying on centralized servers
  • Cryptographic Verification: IPFS ensures the integrity of the code through content hashing

Secure AI Integration

Your data remains secure because AI integration happens through your own accounts rather than public accounts:

  • Your Own AI Provider: You choose your LLM and AI provider (OpenAI, Google, Anthropic, etc.)
  • Your API Keys: Use your own API credentials for complete control
  • Direct Communication: Data flows directly from your browser to your chosen AI service
  • No Middleman: BizFirstAI never sees or processes your sensitive data

Advanced Use Cases

AI Intent Detection

Use JSON data for AI intent detection by converting structured data into actionable insights:

// Example: Convert user interaction JSON to intent analysis const userInteractionData = { "clicks": ["login", "dashboard", "settings"], "timeSpent": [30, 120, 45], "previousActions": ["view_profile", "edit_settings"] }; // Send to AI for intent detection const intentPrompt = `Analyze this user behavior JSON and determine user intent: ${JSON.stringify(userInteractionData)}`;

Natural Language Processing for AI Outputs

Convert AI output JSON into natural language processing for better human understanding:

// Example: Convert AI analysis results to readable format const aiAnalysisResult = { "confidence": 0.95, "classification": "financial_transaction", "risk_factors": ["high_amount", "new_recipient"], "recommendation": "require_additional_verification" }; // Convert to natural language const nlpPrompt = `Convert this AI analysis JSON into a human-readable explanation: ${JSON.stringify(aiAnalysisResult)}`;

API Services Integration

Establish simplified integration with API services and prepare data for various protocols:

  • API Request Formatting: Format JSON for different API endpoints with specific requirements
  • Response Processing: Convert API responses into formats suitable for your application
  • Data Transformation: Transform data between different API schemas and formats
  • Validation Pipeline: Ensure data integrity before sending to critical API services

Model Context Protocol (MCP) Integration

Simplified integration with Model Context Protocol for advanced AI interactions:

MCP Benefits:

  • Context Preservation: Maintain conversation context across multiple AI interactions
  • Tool Integration: Seamlessly integrate with various AI tools and services
  • Protocol Standardization: Use standardized JSON formats for AI communication
  • Enhanced AI Capabilities: Enable more sophisticated AI reasoning and responses
// Example MCP integration const mcpContext = { "conversation_id": "conv_12345", "tools": ["json_formatter", "validator", "ai_analyzer"], "context": { "user_intent": "validate_blockchain_transaction", "security_level": "high", "previous_validations": [] } }; // Use with AI services that support MCP const mcpRequest = formatForMCP(transactionData, mcpContext);

Enterprise Security Deployment

For organizations requiring maximum security:

  1. Self-Hosted Deployment: Deploy on your own infrastructure
  2. IPFS Pinning: Pin the application to your own IPFS nodes
  3. Air-Gapped Environments: Run completely offline for sensitive operations
  4. Custom AI Integration: Integrate with your own private AI models

Getting Started

  1. Basic Use: Try the formatter now
  2. Test Integration: View test examples
  3. Download: Clone from GitHub for self-hosting
  4. Integrate: Use the URL parameter format in your application