Giter Club home page Giter Club logo

astro-api-php-client's Introduction

AstrologyAPI-PHP-Client

This is PHP client to consume APIs from AstrologyAPI.com

Where to get API Key

You can visit https://www.astrologyapi.com/ to get the astrology API key to be used for your websites or mobile applications.

How to Use

  1. Copy src/VedicRishiClient.php and src/sdk.php files to your local or server file system

  2. Instantiate VedicRishiClient class as follows -

    $clientInstance = new VedicRishiClient($userId, $apiKey);

    Replace $userId and $apiKey with your id and keys respectively. You can get the API key details from https://www.astrologyapi.com/

  3. You can call the functions for the respective APIs by passing the birth data and other relevant data (if required) as argument. Eg. for calling the /planets/ api, use the following function as shown below

    $response = $clientInstance->getPlanetDetails($date, $month, $year, $hour, $min, $lat, $lon, $tzone);

    View astrology.php for more details about calling APIs related to astrology.

  4. The $response will be a JSON encoded data returned as an API response. Eg. for /planets/ api -

    [
        {
            "id":0,
            "name":"SUN",
            "fullDegree":95.83230788313479,
            "normDegree":5.8323078831347885,"speed":0.9547191489638442,
            "isRetro":"false",
            "sign":"CANCER",
            "signLord":"MOON",
            "nakshatra":"PUSHYA",
            "nakshatraLord":7,
            "house":11
        }
        ...
    ]
  5. For calling numerological api, call the respective function. Eg. to get numerology report call getNumeroReport() as follows -

        $response = $clientInstance->getNumeroReport($date, $month, $year, $name);

    Only date, month and year along with name is required for numerological calculations. Run the numerolgy.php file to test functions related to numerological APIs.

  6. For match making horoscope calculations and report analysis, use matchmaking related functions. Eg. to get matchmaking report, use getMatchMakingReport() function as follows -

            $response = $clientInstance->getMatchMakingReport(array $maleBirthData, array $femaleBirthData);
    
    
    //where  $maleBirthData and $femaleBirthData is mapped as follows -
    
                    $femaleData = array(
    
                        'date' => 9,
                        'month' => 12,
                        'year' => 1990,
                        'hour' => 12,
                        'minute' => 56,
                        'latitude' => 25.123,
                        'longitude' => 82.34,
                        'timezone' => 5.5
                    );
    
                    $maleData = array(
    
                        'date' => 25,
                        'month' => 12,
                        'year' => 1988,
                        'hour' => 4,
                        'minute' => 0,
                        'latitude' => 25.123,
                        'longitude' => 82.34,
                        'timezone' => 5.5
                    );

Run matching.php file to test functions related to AstrologyAPI Match Making APIs. For API documentation, visit - https://www.astrologyapi.com/docs/

astro-api-php-client's People

Contributors

ritz101293 avatar chandantiwari avatar vivekrto9 avatar ajeetkanojia avatar vivekrt9 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.