Astro96.Api
0.3.2
dotnet add package Astro96.Api --version 0.3.2
NuGet\Install-Package Astro96.Api -Version 0.3.2
<PackageReference Include="Astro96.Api" Version="0.3.2" />
<PackageVersion Include="Astro96.Api" Version="0.3.2" />
<PackageReference Include="Astro96.Api" />
paket add Astro96.Api --version 0.3.2
#r "nuget: Astro96.Api, 0.3.2"
#:package Astro96.Api@0.3.2
#addin nuget:?package=Astro96.Api&version=0.3.2
#tool nuget:?package=Astro96.Api&version=0.3.2
96Astro API client for .NET
Compiled and run in our tests on the oldest version named below: tools/sdk/thin_conformance/run.py checks its requests, retries and errors, and makes one real call to the API.
Full guide (install, first call, errors, retries, PDF and audio jobs, webhook verification): https://96astroapi.com/docs/sdk-dotnet
Install
Add Astro96.cs to your project, or build the package from Astro96.csproj. It needs .NET 8 and has no dependencies.
Use
var astro = new Astro96Client(Environment.GetEnvironmentVariable("ASTRO_API_KEY")!);
var json = await astro.PlanetPositionsAsync("{\"datetime\":\"1990-10-18T14:30:00\",\"timezone\":\"Asia/Kolkata\",\"latitude\":28.6139,\"longitude\":77.209}");
There is one method for each capability in the API reference. Each takes the request as a JSON string and returns the response as a JSON string, so you can parse it with whatever your app already uses.
Name your app (optional)
Optional: tell the API which app is calling, so you can see where your keys are used (the dashboard's Where your keys are used) and spot a leaked key.
var astro = new Astro96Client(key, appName: "Acme Shop", appVersion: "2.1.0", appUrl: "https://shop.acme.com");
The name is required (printable ASCII, at most 60 characters, no / or parentheses); the version (at most 40) and the url (http(s), at most 120) are optional. It is sent as the X-Astro-App header, never with your key; the API keeps the name, the version and only the host of the url. The User-Agent also carries the platform (plt/node, plt/linux...). An invalid value is refused when the client is created.
Keep your secret key on your server, and never ship it in an app. The API's error code is on the error this client raises. Calls that fail with a retryable error are retried with the same idempotency key, so they are never charged twice.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.