JSON โ CSV Conversion API
๐งช Code Examples
๐ Getting Started
- Create an account or log in
- Generate an API key from your dashboard
- Send JSON or CSV to the API
- View usage and limits in your report
- All examples assume:
- Endpoint: POST /api/convert/csv-to-json
- Header: X-API-KEY
- JSON payload format
๐งช Code Examples
curl -X POST https://yourdomain.com/api/convert/json-to-csv \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"json": [
{ "name": "Alice", "age": 30 },
{ "name": "Bob", "age": 25 }
]
}'
const response = await fetch(
"https://yourdomain.com/api/convert/json-to-csv",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": process.env.API_KEY
},
body: JSON.stringify({
json: [
{ name: "Alice", age: 30 },
{ name: "Bob", age: 25 }
]
})
}
);
const result = await response.json();
console.log(result.csv);
import requests
url = "https://yourdomain.com/api/convert/json-to-csv"
headers = {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"json": [
{"name": "Alice", "age": 30},
{"name": "Bob", "age": 25}
]
}
response = requests.post(url, json=payload, headers=headers)
print(response.json()["csv"])
using System.Net.Http.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY");
var response = await client.PostAsJsonAsync(
"https://yourdomain.com/api/convert/json-to-csv",
new
{
json = new[]
{
new { name = "Alice", age = 30 },
new { name = "Bob", age = 25 }
}
});
var result = await response.Content.ReadFromJsonAsync();
Console.WriteLine(result.csv);
$headers = @{
"X - API - KEY" = "YOUR_API_KEY"
"Content-Type" = "application/json"
}
$body = @{
json = @(
@{ name = "Alice"; age = 30 },
@{ name = "Bob"; age = 25 }
)
} | ConvertTo - Json
$response = Invoke - RestMethod `
-Uri "https://yourdomain.com/api/convert/json-to-csv" `
-Method Post `
-Headers $headers `
-Body $body
$response.csv
๐ Request Payload
{
"json": [
{ "name": "Alice", "age": 30 },
{ "name": "Bob", "age": 25 }
]
}
๐ค Response Example
{
"csv": "name,age\nAlice,30\nBob,25"
}
๐ Security & Privacy
- All requests require an API key
- API keys are hashed and never stored in plaintext
- All traffic is encrypted via HTTPS
- Converted data is never stored
- Only request metadata (timestamp, endpoint, status) is recorded
๐ Usage Limits
- Free tier: 100 requests per day
- Paid tiers: usage billed in credits
- 1 credit = 1,000 successful API calls
Tip: Your API key is shown only once. Store it securely or regenerate it from your dashboard.