Debut avec l'API Numerology¶
Ce guide vous montre comment authentifier, configurer l'URL de base, en-têtes requis, gérer les erreurs et faire une première requête fonctionnelle pour le point d'accès Life Path Number.
1. S'inscrire & Obtenir votre clé API¶
- Allez sur le dashboard RapidAPI.
- Abonnez-vous à un plan (niveau gratuit = 100 req/mo).
- Copiez votre
x-rapidapi-key.
2. URL de base & En-tête Host¶
| Item | Valeur |
|---|---|
| URL de base | https://the-numerology-api.p.rapidapi.com |
| En-tête Host | the-numerology-api.p.rapidapi.com |
Conseil: Incluez toujours les deux en-têtes – RapidAPI valide le host.
3. En-têtes requis (toutes les requêtes)¶
x-rapidapi-key: VOTRE_CLE_RAPIDAPI
x-rapidapi-host: the-numerology-api.p.rapidapi.com
Content-Type: application/json (seulement pour les corps POST)
4. Première requête – Life Path Number (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: VOTRE_CLE_RAPIDAPI" \
--header "x-rapidapi-host: the-numerology-api.p.rapidapi.com"
Réponse
{
"life_path_number": 7,
"summary": "Le nombre de chemin de vie 7 incarne l'introspection, la spiritualité et la pensée analytique.",
"detailed_meaning": "Le chiffre 7 représente l'introspection, la spiritualité..."
}
5. Version POST (corps JSON)¶
curl --request POST \
--url https://the-numerology-api.p.rapidapi.com/life_path/post \
--header "x-rapidapi-key: VOTRE_CLE_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. Snippets spécifiques à la langue¶
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": "VOTRE_CLE_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: VOTRE_CLE_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": "VOTRE_CLE_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': 'VOTRE_CLE_RAPIDAPI',
'x-rapidapi-host': 'the-numerology-api.p.rapidapi.com'
}
})
.then(res => console.log(res.data));
7. Erreurs courantes & Dépannage¶
| Code | Signification | Solution |
|---|---|---|
400 | Paramètre requis manquant | Fournir birth_year, birth_month, birth_day (ou nommer les champs) |
401 | Clé API invalide | Vérifiez à nouveau x-rapidapi-key |
429 | Limite de débit dépassée | Mise à niveau du plan ou attendez le mois suivant |
500 | Erreur serveur | Réessayez ; signalez via GitHub Issues |
8. Étapes suivantes¶
- Parcourez la Référence API pour tous les points d'accès de plus de 100.
- Explorez Prix pour choisir le bon niveau.
- Vérifiez le Changelog pour les dernières fonctionnalités.