PHP Code Snippets for Dakidarts Numerology API¶
These examples demonstrate how to call Core, Karmic, Cycles, and Horoscope endpoints using PHP and the RapidAPI key.
Setup¶
<?php
$headers = [
"x-rapidapi-key: YOUR_RAPIDAPI_KEY",
"Content-Type: application/json"
];
function sendGetRequest($url, $params = []) {
global $headers;
$query = http_build_query($params);
$ch = curl_init("$url?$query");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
function sendPostRequest($url, $payload = []) {
global $headers;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
?>
Example 1: Attitude Number¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/attitude_number";
$params = ["birth_day" => "14", "birth_month" => "3"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 2: Challenge Number¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/challenge_number/post";
$payload = ["birth_year" => 1990, "birth_month" => 5, "birth_day" => 15];
$response = sendPostRequest($url, $payload);
print_r($response);
?>
Example 3: Karmic Debt¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/karmic_debt";
$params = ["birth_year" => "2023", "birth_month" => "6", "birth_day" => "28"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 4: Karmic Lessons¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/karmic_lessons";
$params = ["full_name" => "John Doe Smith"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 5: Life Path Number¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/life_path";
$params = ["birth_year" => "1990", "birth_month" => "5", "birth_day" => "12"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 6: Personality Number¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/personality_number/post";
$payload = ["first_name" => "John", "middle_name" => "Robert", "last_name" => "Doe"];
$response = sendPostRequest($url, $payload);
print_r($response);
?>
Example 7: Destiny Number¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/destiny_number";
$params = ["first_name" => "John", "middle_name" => "Doe", "last_name" => "Smith"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 8: Heart Desire Number¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/heart_desire";
$params = ["first_name" => "John", "middle_name" => "Robert", "last_name" => "Doe"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 9: Personal Year¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/personal_year";
$params = ["prediction_year" => "2023", "birth_month" => "12", "birth_day" => "3"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 10: Ancestor Reading¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/ancestor-reading";
$params = ["family_name" => "Etuge"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 11: Planes Of Expression¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/planes-of-expression";
$payload = ["fullname" => "Jesus Christ"];
$response = sendPostRequest($url, $payload);
print_r($response);
?>
Example 12: Today Horoscope¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/horoscope/today";
$params = ["dob" => "2002-02-22"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 13: Today Career Horoscope¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/horoscope/career/today";
$payload = ["dob" => "1995-08-20"];
$response = sendPostRequest($url, $payload);
print_r($response);
?>
Example 14: Today Health Horoscope¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/horoscope/health/today";
$params = ["dob" => "1995-08-20"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 15: Planetary Daily Horoscope¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/horoscope/planetary/daily";
$params = ["dob" => "1990-01-01", "day" => "today"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 16: Essence Cycle¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/essence-cycle";
$params = ["full_name" => "Alexander Graham Bell", "dob" => "1847-03-03", "start_year" => "1847"];
$response = sendGetRequest($url, $params);
print_r($response);
?>
Example 17: Transits¶
<?php
$url = "https://the-numerology-api.p.rapidapi.com/transits";
$payload = ["full_name" => "Alexander Graham Bell", "dob" => "1847-03-03"];
$response = sendPostRequest($url, $payload);
print_r($response);
?>
Note
- All endpoints support GET and POST methods (where applicable).
- Replace
"YOUR_RAPIDAPI_KEY"with your valid key. - Use
paramsfor GET requests andpayload/jsonfor POST requests.