Download the PHP package projectsaturnstudios/venusian-stargazer without Composer

On this page you can find all versions of the php package projectsaturnstudios/venusian-stargazer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package venusian-stargazer

Venusian Stargazer

Tests

NASA's open APIs for Venusian apps.

Requirements

Installation

After install, call nasa().

Stargazer uses NASA's shared DEMO_KEY by default, which is rate-limited to 30 requests an hour. Get a free key at api.nasa.gov and set it in .env:

To publish the config file:

Usage

Pick an API family, then an endpoint. Nothing is sent until get() or async(). get() blocks and returns a DTO for a single object, or a Collection of DTOs for a list. A non-2xx response throws StargazerException, whose status() is the HTTP status, so a caller can tell a 429 from a 404 from a 503. async() returns a promise on the event loop that fulfils with what get() returns and rejects with what it throws. With no loop bound, async() throws StargazerException.

On the event loop

Two async() calls run concurrently. wait() resolves each one to its DTOs:

Query parameters

with() adds any parameter NASA accepts and returns a new request:

Fetching media

Some DTOs can fetch their own media on the loop. Each method returns a promise of the HTTP response. The bytes are in body().

DTO Method Notes
AstronomyPicture (APOD) render(bool $hd = false) Fetches the screen-sized picture, the full-size hdurl with $hd, or a video day's mp4. Returns null on an embed day, such as a YouTube video.
EpicImage (EPIC) render(EpicCollection $collection, EpicImageType $type = EpicImageType::PNG) Builds the archive URL from the image's date.
ImageLocation (Image Library) fetch() Follows the location pointer returned by asset(), metadata() and captions().

Supported APIs

Accessor API Endpoints
apod() Astronomy Picture of the Day date, range, count
neows() Near Earth Object Web Service feed, lookup, browse
donki() Space Weather Database (DONKI) cme, cmeAnalysis, gst, ips, flr, sep, mpc, rbe, hss, wsaEnlilSimulations, notifications
eonet() Earth Observatory Natural Event Tracker v3 events, categories, sources, layers, magnitudes
epic() Earth Polychromatic Imaging Camera natural, enhanced, naturalAvailable, enhancedAvailable
insight() InSight Mars Weather weather
tle() Two-Line Element sets collection, search, satellite
techtransfer() NASA Technology Transfer patent, software, spinoff
imageLibrary() NASA Image and Video Library search, asset, metadata, captions
gibs() Global Imagery Browse Services wmts(), wms(), twms(), colormap, legend, layerMetadata, vectorMetadata, vectorStyle
exoplanet() NASA Exoplanet Archive (TAP) adql, planets, planet
trek() Solar System Treks WMTS (Moon, Mars, Vesta) layers, capabilities, tile

Your key goes to NeoWs, EPIC and InSight. APOD comes from science.nasa.gov's APOD API, which replaced the api.nasa.gov one (archived December 1, 2026). DONKI is served by NASA's CCMC (ccmc.gsfc.nasa.gov/DONKI-API) since its September 2026 move. Neither takes a key, and nor do the Exoplanet Archive and Trek.

Not yet supported

openScience(), ssc(), ssd() and techport() exist and throw NotYetSupportedException.

Exoplanets and Trek

planets() and planet() read pscomppars, one row per planet; adql() runs any ADQL. A limit goes in maxrec, because the archive applies TOP before ORDER BY. Trek's capabilities() answers the same WmtsCapabilities as GIBS, so its layer formats and tile matrix sets read the same way.

API reference

Dates are Y-m-d strings. A null argument is left off the request, so NASA's default applies. Enums live under each family's Enums namespace, for example ProjectSaturnStudios\Stargazer\DONKI\Enums\DonkiCatalog.

APOD

Method Returns
date(?string $date = null) AstronomyPicture. With no date, it asks for today in your app's timezone.
range(string $start, ?string $end = null) Collection<AstronomyPicture>, oldest first. $end defaults to today. At most 100 days; more throws InvalidArgumentException.
count(int $count) Collection<AstronomyPicture>: $count (1 to 100) consecutive days from a random point in the archive, oldest first. The API has no random pick, so it asks for a random page.

AstronomyPicture has date, title, explanation, url, hdurl, media_type, copyright, thumbnail_url, permalink and alt.

NeoWs

Method Returns
feed(?string $start_date = null, ?string $end_date = null) NeoFeed: element_count, and near_earth_objects keyed by date
lookup(string $asteroid_id) NearEarthObject
browse(?int $page = null, ?int $size = null) NeoBrowse: near_earth_objects, and page with total_elements and total_pages

NearEarthObject has id, name, absolute_magnitude_h, estimated_diameter, is_potentially_hazardous_asteroid, close_approach_data, orbital_data and is_sentry_object.

DONKI

Every endpoint takes $from and $to, sent as startDate and endDate, and returns a Collection of the DTO below.

Method Extra arguments DTO ID field
cme() Cme activityID
cmeAnalysis() CmeAnalysis associatedCMEID
gst() GeomagneticStorm gstID
ips() ?string $location, DonkiCatalog\|string\|null $catalog InterplanetaryShock activityID
flr() ?string $class, DonkiCatalog\|string\|null $catalog Flare flrID
sep() SolarEnergeticParticle sepID
mpc() MagnetopauseCrossing mpcID
rbe() RadiationBeltEnhancement rbeID
hss() HighSpeedStream hssID
wsaEnlilSimulations() WsaEnlilSimulation simulationID
notifications() DonkiNotificationType\|string\|null $type Notification messageID

DonkiIpsLocation lists the values ips() accepts for $location: Earth, Mars, MESSENGER, STEREO A, STEREO B and ALL. Pass its ->value. CmeAnalysis reports its featureCode as one of the codes in DonkiAnalysisFeature.

EONET

Method Returns
events() EonetEventsPage, with events
categories(?string $id = null) EonetCategoriesPage, with categories
sources() EonetSourcesPage, with sources
layers(?string $id = null) EonetLayersPage, with categories
magnitudes() EonetMagnitudesPage, with magnitudes

EONET filters go through with(), for example status, limit, days, category and source. EonetEvent has id, title, closed, categories, sources and geometry.

EPIC

Method Returns
natural(?string $date = null) Collection<EpicImage>. With no date, the most recent day.
enhanced(?string $date = null) Collection<EpicImage>
naturalAvailable() Collection<EpicAvailableDate>, each with a date
enhancedAvailable() Collection<EpicAvailableDate>

EpicImage has identifier, caption, image, date, centroid, the dscovrPosition, lunarPosition and sunPosition vectors, and attitude. archiveUrl() builds the image URL, and render() fetches it.

InSight

Method Returns
weather() InsightWeather: solKeys, sols and validity

Each InsightSol has sol, season as an InsightSeason, firstUtc, lastUtc, and temperature, windSpeed, pressure and windDirection summaries.

TLE

Method Returns
collection() TleCollection: totalItems and members
search(string $query) TleCollection
satellite(int\|string $id) TleRecord: satelliteId, name, date, line1 and line2

TechTransfer

Method Returns
patent(string $query) TechTransferPage
software(string $query) TechTransferPage
spinoff(string $query) TechTransferPage

TechTransferPage has results, count, total, perPage and page. Each TechTransferRecord has title, description, category, center, imageUrl and detailUrl.

Image and Video Library

Method Returns
search(?string $q = null) ImageSearchPage: totalHits, and items, each with data and links
asset(string $nasa_id) ImageAssetManifest: items, one per file
metadata(string $nasa_id) ImageLocation, which points at a JSON file
captions(string $nasa_id) ImageLocation, which points at a caption file

metadata() and captions() return where the file lives, not the file itself. fetch() gets it:

Each ImageItemData has nasaId, title, description, center, dateCreated, mediaType as an ImageMediaType, keywords and photographer.

GIBS

NASA's Global Imagery Browse Services: daily satellite imagery and data layers as tiles and maps. No key. Images come back as the Http Response; decode body() with whatever draws them.

Method Returns
wmts($projection, $set)->capabilities() / tile() / vectorTile() / domains() WmtsCapabilities / Response / GibsVectorTile / WmtsDomains; RESTful or KVP
wms(…)->capabilities($version) / map() / legendGraphic() WmsCapabilities / Response / Response
twms(…)->capabilities() / tileService() / tile($pattern) / map() WmsCapabilities / TwmsTileService / Response / Response
colormap($id, $version) GibsColorMaps (v1.0 or v1.3)
legend($id, $orientation, $format) Response (SVG or PNG)
layerMetadata($id), vectorMetadata($id) GibsLayerMetadata
vectorStyle($id) GibsVectorStyle, whose layers evaluate their paint and layout for a feature at a zoom

Projections: GibsProjection::EPSG4326, EPSG3857, EPSG3413 (Arctic), EPSG3031 (Antarctic). Imagery sets: BEST, STANDARD, NEAR_REAL_TIME, ALL. Capabilities run to megabytes: hold on to the WmtsCapabilities you get, or cache the document at capabilities()->url() and rebuild it with WmtsCapabilities::fromXml().

Testing

The suite never calls NASA. It runs against captured JSON fixtures and Http fakes on a real event loop.

License

MIT. See LICENSE.


All versions of venusian-stargazer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4|^8.5
venusian-voyager/http Version ^0.10.0
venusian-voyager/io-pools Version ^0.10.0
venusian-voyager/nuts-and-bolts Version ^0.10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package projectsaturnstudios/venusian-stargazer contains the following files

Loading the files please wait ...