- Loosely based on the spotify api wrapper, built only for v2 of SpaceTraders
- Should have all current endpoints and be easily update-able for future updates.
- All Data Models created using the OpenAPI tool
The default generation from OpenAPI CLI isn't very developer friendly so I created this version for those that prefer an easier C# API.
Without existing token:
- dotnet add package SpaceTradersDotNetSDK
- Create a client instance
var spaceTraderClient = new SpaceTraderClient(httpClient, "");
- Create an Agent
var registeredResponse = await spaceTraderClient.Register.Register(FactionType.COSMIC, "yourcallsign");
- Now update the client with
spaceTraderClient.UpdateToken(registeredResponse.Token);
- Then proceed as normal to query
var response = await spaceTraderClient.Fleet.ListMyShips(10, 1);
With existing token:
- dotnet add package SpaceTradersDotNetSDK
- Create a client instance
var spaceTraderClient = new SpaceTraderClient(httpClient, access_token);
- Query something
var response = await spaceTraderClient.Fleet.ListMyShips(10, 1);