Introducción a The Numerology API¶
Esta guía te lleva paso a paso por la autenticación, la URL base, los encabezados requeridos, el manejo de errores y cómo hacer tu primera solicitud funcional al endpoint de Número del Camino de Vida (Life Path Number).
1. Regístrate y obtén tu clave API¶
- Dirígete al panel de RapidAPI.
- Suscríbete a un plan (el plan gratuito incluye 100 solicitudes/mes).
- Copia tu clave:
x-rapidapi-key.
2. URL base y encabezado Host¶
| Elemento | Valor |
|---|---|
| URL base | https://the-numerology-api.p.rapidapi.com |
| Encabezado Host | the-numerology-api.p.rapidapi.com |
Consejo: Siempre incluye ambos encabezados — RapidAPI valida el host.
3. Encabezados requeridos (todas las solicitudes)¶
x-rapidapi-key: TU_CLAVE_RAPIDAPI
x-rapidapi-host: the-numerology-api.p.rapidapi.com
Content-Type: application/json (solo para cuerpos POST)
4. Primera solicitud – Número del Camino de Vida (GET)¶
curl --request GET \
--url "https://the-numerology-api.p.rapidapi.com/life_path?birth_year=1990&birth_month=5&birth_day=15" \
--header "x-rapidapi-key: TU_CLAVE_RAPIDAPI" \
--header "x-rapidapi-host: the-numerology-api.p.rapidapi.com"
Respuesta esperada (ejemplo):
{
"life_path_number": 7,
"summary": "El número del camino de vida 7 encarna la introspección, la espiritualidad y el pensamiento analítico.",
"detailed_meaning": "El número 7 representa introspección, espiritualidad..."
}
5. Variante POST (cuerpo JSON)¶
curl --request POST \
--url https://the-numerology-api.p.rapidapi.com/life_path/post \
--header "x-rapidapi-key: TU_CLAVE_RAPIDAPI" \
--header "x-rapidapi-host: the-numerology-api.p.rapidapi.com" \
--header "Content-Type: application/json" \
--data '{
"birth_year": "1990",
"birth_month": "5",
"birth_day": "15"
}'
6. Ejemplos en diferentes lenguajes¶
Python (requests)¶
import requests
url = "https://the-numerology-api.p.rapidapi.com/life_path"
params = {"birth_year": "1990", "birth_month": "5", "birth_day": "15"}
headers = {
"x-rapidapi-key": "TU_CLAVE_RAPIDAPI",
"x-rapidapi-host": "the-numerology-api.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
PHP (cURL)¶
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://the-numerology-api.p.rapidapi.com/life_path?birth_year=1990&birth_month=5&birth_day=15",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"x-rapidapi-host: the-numerology-api.p.rapidapi.com",
"x-rapidapi-key: TU_CLAVE_RAPIDAPI"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
JavaScript (Fetch)¶
const url = new URL("https://the-numerology-api.p.rapidapi.com/life_path");
url.searchParams.append("birth_year", "1990");
url.searchParams.append("birth_month", "5");
url.searchParams.append("birth_day", "15");
fetch(url, {
method: "GET",
headers: {
"x-rapidapi-key": "TU_CLAVE_RAPIDAPI",
"x-rapidapi-host": "the-numerology-api.p.rapidapi.com"
}
})
.then(r => r.json())
.then(console.log);
Node.js (axios)¶
const axios = require('axios');
axios.get('https://the-numerology-api.p.rapidapi.com/life_path', {
params: { birth_year: 1990, birth_month: 5, birth_day: 15 },
headers: {
'x-rapidapi-key': 'TU_CLAVE_RAPIDAPI',
'x-rapidapi-host': 'the-numerology-api.p.rapidapi.com'
}
})
.then(res => console.log(res.data));
7. Errores comunes y solución de problemas¶
| Código | Significado | Solución |
|---|---|---|
400 | Parámetro requerido faltante | Proporciona birth_year, birth_month, birth_day (o campos de nombre) |
401 | Clave API inválida | Verifica que x-rapidapi-key sea correcta |
429 | Límite de solicitudes excedido | Mejora tu plan o espera al próximo mes |
500 | Error interno del servidor | Reintenta; reporta el problema en GitHub Issues |
8. Próximos pasos¶
- Explora la Referencia de la API para conocer los más de 100 endpoints disponibles.
- Revisa los Precios y elige el plan que mejor se adapte a ti.
- Consulta el Historial de cambios para estar al día con las nuevas funcionalidades.
¡Estás listo para comenzar a integrar la numerología en tus proyectos!