Endpoints Disponibles
| Endpoint | Metodo | Descripcion |
|---|---|---|
| /mylife | POST | Busca por nombre, apellido, ubicacion y edad |
| /phone | POST | Busca por numero de telefono |
POST
/mylife
Realiza una busqueda de persona utilizando nombre, apellido, ubicacion geografica y edad. Ideal para localizar individuos con datos demograficos basicos.
Request Body Parameters
| Parametro | Tipo | Requerido | Descripcion |
|---|---|---|---|
| firstname | string | Si | Nombre de la persona |
| lastname | string | Si | Apellido de la persona |
| location | string | Si | Ciudad o estado de residencia |
| age | integer | Si | Edad de la persona |
Bash / cURL
curl -X POST http://localhost:8956/mylife \
-H "Content-Type: application/json" \
-d '{
"firstname": "John",
"lastname": "Doe",
"location": "Ohio",
"age": 35
}'
JavaScript / Node.js
// Usando fetch (Node.js 18+)
const response = await fetch('http://localhost:8956/mylife', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
firstname: 'John',
lastname: 'Doe',
location: 'Ohio',
age: 35
})
});
const data = await response.json();
console.log(data);
// Usando axios
const axios = require('axios');
const { data } = await axios.post('http://localhost:8956/mylife', {
firstname: 'John',
lastname: 'Doe',
location: 'Ohio',
age: 35
});
console.log(data);
Python
import requests
# Usando requests
url = "http://localhost:8956/mylife"
payload = {
"firstname": "John",
"lastname": "Doe",
"location": "Ohio",
"age": 35
}
response = requests.post(url, json=payload)
data = response.json()
print(data)
# Usando httpx (async)
import httpx
import asyncio
async def search_mylife():
async with httpx.AsyncClient() as client:
response = await client.post(
"http://localhost:8956/mylife",
json={
"firstname": "John",
"lastname": "Doe",
"location": "Ohio",
"age": 35
}
)
return response.json()
result = asyncio.run(search_mylife())
POST
/phone
Realiza una busqueda utilizando un numero de telefono. Permite obtener informacion asociada a un numero especifico.
Request Body Parameters
| Parametro | Tipo | Requerido | Descripcion |
|---|---|---|---|
| number | string | Si | Numero de telefono (solo digitos) |
Bash / cURL
curl -X POST http://localhost:8956/phone \
-H "Content-Type: application/json" \
-d '{"number": "4192971938"}'
JavaScript / Node.js
// Usando fetch (Node.js 18+)
const response = await fetch('http://localhost:8956/phone', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
number: '4192971938'
})
});
const data = await response.json();
console.log(data);
// Usando axios
const axios = require('axios');
const { data } = await axios.post('http://localhost:8956/phone', {
number: '4192971938'
});
console.log(data);
Python
import requests
# Usando requests
url = "http://localhost:8956/phone"
payload = {
"number": "4192971938"
}
response = requests.post(url, json=payload)
data = response.json()
print(data)
# Usando httpx (async)
import httpx
import asyncio
async def search_phone(phone_number: str):
async with httpx.AsyncClient() as client:
response = await client.post(
"http://localhost:8956/phone",
json={"number": phone_number}
)
return response.json()
result = asyncio.run(search_phone("4192971938"))