Elysia Tools
Navegación
Data Formats
Ejemplos de JSON
Ejemplos de formato JSON (JavaScript Object Notation) desde estructuras simples hasta complejas
Ejemplos
Entradas de esta colección
Objeto JSON simple
Objeto JSON básico con pares clave-valor
{
"name": "John Doe",
"age": 30,
"isStudent": false,
"email": "[email protected]"
}Array JSON
Array JSON que contiene múltiples valores
[
"apple",
"banana",
"cherry",
"date",
"elderberry"
]Array de objetos JSON
Array JSON que contiene múltiples objetos
[
{
"id": 1,
"name": "Alice",
"age": 25,
"city": "New York"
},
{
"id": 2,
"name": "Bob",
"age": 30,
"city": "London"
},
{
"id": 3,
"name": "Charlie",
"age": 35,
"city": "Tokyo"
}
]Objeto JSON anidado
Objeto JSON que contiene objetos anidados
{
"user": {
"name": "John Doe",
"profile": {
"age": 30,
"gender": "male",
"address": {
"street": "123 Main St",
"city": "New York",
"country": "USA"
}
}
}
}JSON con tipos mixtos
Objeto JSON con varios tipos de datos, incluidos arrays, objetos y primitivos
{
"name": "Product Catalog",
"version": 1.0,
"isActive": true,
"products": [
{
"id": "P001",
"name": "Laptop",
"price": 999.99,
"inStock": 10,
"tags": ["electronics", "computers"]
},
{
"id": "P002",
"name": "Smartphone",
"price": 599.99,
"inStock": 25,
"tags": ["electronics", "mobile"]
}
],
"lastUpdated": "2025-01-01T12:00:00Z"
}Estructura JSON compleja
JSON complejo con arrays anidados, objetos y varios tipos de datos
{
"company": {
"name": "Tech Corp",
"founded": 2000,
"industry": "Technology",
"location": {
"country": "USA",
"city": "San Francisco",
"coordinates": {
"lat": 37.7749,
"lng": -122.4194
}
},
"departments": [
{
"name": "Engineering",
"head": "Alice Smith",
"employees": [
{
"id": "EMP001",
"name": "Bob Johnson",
"position": "Software Engineer",
"skills": ["JavaScript", "Python", "React"]
},
{
"id": "EMP002",
"name": "Charlie Davis",
"position": "Backend Developer",
"skills": ["Go", "Node.js", "PostgreSQL"]
}
],
"projects": [
{
"name": "Project Alpha",
"status": "active",
"deadline": "2025-06-01"
},
{
"name": "Project Beta",
"status": "planning",
"deadline": "2025-09-01"
}
]
},
{
"name": "Marketing",
"head": "Diana Evans",
"employees": [
{
"id": "EMP003",
"name": "Ethan Wilson",
"position": "Marketing Manager",
"skills": ["Digital Marketing", "SEO", "Social Media"]
}
],
"projects": [
{
"name": "Campaign X",
"status": "active",
"deadline": "2025-05-15"
}
]
}
],
"financials": {
"revenue": 1000000000,
"profit": 150000000,
"expenses": 850000000,
"quarters": [
{ "quarter": 1, "revenue": 240000000, "profit": 35000000 },
{ "quarter": 2, "revenue": 250000000, "profit": 40000000 },
{ "quarter": 3, "revenue": 260000000, "profit": 45000000 },
{ "quarter": 4, "revenue": 250000000, "profit": 30000000 }
]
},
"tags": ["tech", "innovation", "growth"]
}
}Respuesta JSON de API
Estructura JSON estándar para respuestas de API
{
"status": "success",
"code": 200,
"message": "Request processed successfully",
"timestamp": "2025-01-01T12:00:00Z",
"data": {
"user": {
"id": "USER12345",
"name": "John Doe",
"email": "[email protected]",
"profile": {
"age": 30,
"gender": "male",
"joinedAt": "2024-01-01T00:00:00Z"
},
"roles": ["user", "subscriber"]
}
},
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalItems": 45,
"itemsPerPage": 10
},
"meta": {
"requestId": "REQ-789012",
"version": "1.0.0"
}
}JSON de configuración
JSON utilizado para ajustes de configuración
{
"app": {
"name": "My Application",
"version": "1.2.3",
"environment": "production",
"debug": false,
"port": 3000
},
"database": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"name": "myapp_db",
"credentials": {
"username": "db_user",
"password": "DB_PASSWORD",
"ssl": true
},
"pool": {
"min": 2,
"max": 10
}
},
"logging": {
"level": "info",
"format": "json",
"outputs": ["console", "file"],
"file": {
"path": "/var/log/myapp.log",
"maxSize": "10MB",
"maxFiles": 5
}
},
"security": {
"cors": {
"enabled": true,
"origins": ["https://elysiatools.com", "https://app.example.com"],
"methods": ["GET", "POST", "PUT", "DELETE"]
},
"jwt": {
"secret": "JWT_SECRET",
"expiresIn": "7d"
}
},
"services": {
"payment": {
"gateway": "stripe",
"apiKey": "STRIPE_API_KEY",
"webhookSecret": "STRIPE_WEBHOOK_SECRET"
},
"email": {
"provider": "sendgrid",
"apiKey": "SENDGRID_API_KEY",
"from": "[email protected]"
}
}
}Ejemplo de GeoJSON
Formato GeoJSON para representar datos geográficos
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "San Francisco",
"population": 873965,
"cityClass": "major"
},
"geometry": {
"type": "Point",
"coordinates": [-122.4194, 37.7749]
}
},
{
"type": "Feature",
"properties": {
"name": "New York City",
"population": 8804190,
"cityClass": "major"
},
"geometry": {
"type": "Point",
"coordinates": [-74.006, 40.7128]
}
},
{
"type": "Feature",
"properties": {
"name": "Los Angeles",
"population": 3898747,
"cityClass": "major"
},
"geometry": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
}
},
{
"type": "Feature",
"properties": {
"name": "California",
"state": "CA"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-124.48201944037265, 40.440630133689096],
[-124.38966410701322, 37.18018892607658],
[-122.2344979653738, 36.99742992327278],
[-114.13122416650424, 32.534136409845824],
[-114.6399218947989, 40.39573804578282],
[-124.48201944037265, 40.440630133689096]
]
]
}
}
]
}JSON con valores vacíos
JSON que muestra varias representaciones de valores vacíos
{
"emptyString": "",
"nullValue": null,
"emptyArray": [],
"emptyObject": {},
"zeroNumber": 0,
"zeroDecimal": 0.0,
"falseBoolean": false
}Sample JSON File
A compact JSON file with objects, arrays, nesting, and mixed value types for the JSON Viewer
Dificultad
1/10
Etiquetas
json, viewer, file, basic
simple.json
JSON · 544 B
- fileSize
- 544 B
- format
- JSON
- extension
- .json
- encoding
- UTF-8
Herramientas
Herramientas que suelen usarse con este ejemplo
Relacionado