PHP code example of omnilab / simbad

1. Go to this page and download the library: Download omnilab/simbad library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

omnilab / simbad example snippets


$simbad = (new SimbadSourceFactory($http))->create(['mailto' => '[email protected]']);
$star = $simbad->entity('Betelgeuse');
$star->id;                               // simbad:* alf Ori
$star->kind;                             // Red Supergiant
$star->property('parallax');             // 6.55 ± 0.83 mas
$star->property('radial_velocity');      // 21.91 ± 0.51 km/s
$star->value('coordinates');             // 05 55 10.3053 +07 24 25.430
$star->property('magnitude_V');          // 0.42 mag
$star->synonyms;                         // * alf Ori, TIC 269273552, HIP 27989, HD 39801... (45)
$simbad->search(new Query('andromeda', limit: 5));   // M 31, Andromeda II, Andromeda I...



mnilab\Simbad\SimbadSourceFactory;

$simbad = (new SimbadSourceFactory())->create(['mailto' => '[email protected]']);   // your address, in the User-Agent
$star = $simbad->entity('Betelgeuse');
echo $star->id, ' (', $star->kind, '), parallax ', $star->property('parallax'), "\n";