The purpose of this project is to create a dead simple C# wrapper for the official Halo® Game Data API (developer.haloapi.com).
HaloSharp attempts to fully support all available official endpoints.
- Create an instance of
HaloClient
(provide your SubscriptionKey and optionally a RateLimit). - Call the
StartSession
method. - Call the
.Query<TResult>()
method and pass in a prepackaged Query object.
var developerAccessProduct = new Product
{
SubscriptionKey = "00000000000000000000000000000000",
RateLimit = new RateLimit
{
RequestCount = 10,
TimspSpan = new TimeSpan(0, 0, 0, 10),
Timeout = Timeout.InfiniteTimeSpan
}
};
var client = new HaloClient(developerAccessProduct);
using (var session = client.StartSession())
{
var query = new GetMatches()
.InGameMode(Enumeration.GameMode.Arena)
.ForPlayer("Furiousn00b");
var matchSet = await session.Query(query);
foreach (var result in matchSet.Results)
{
Console.WriteLine($"MatchId: {result.Id.MatchId}");
}
}
A Nuget package is available at www.nuget.org/packages/HaloSharp
PM> Install-Package HaloSharp
- Updated Medal enum.
- New Medal Type: Ball
- Updated Requisition model.
- New property: HideIfNotAcquired
- Updated CampaignMatch model.
- New property: CharacterIndex
- Updated MatchSet model.
- New property: MatchCompletedDateFidelity
- Query validation.
- Validation exceptions will be thrown for bad queries (missing mandatory fields, invalid gamertags etc.).
- Updated GetArenaServiceRecord query.
- New SeasonId parameter.
- Updated ArenaServiceRecord model.
- New property: ArenaPlaylistStatsSeasonId
- New property: HighestCsrSeasonId
- Updated Requisition model.
- New property: LevelRequirement
- Rate Limiter
- Optional rate limiter with timeout settings.
- JSON Structural Validation (JSON Schema).
- A significant update to the test harness. Using JSON schemas to detect changes to API responses.
- Serialization.
- Strongly typed models are now serializable.
- Metadata Endpoints.
- Seasons
- Profile Endpoints
- Emblem Url
- Spartan Url
- Metadata Endpoints
- Campaign Missions
- Commendations
- CSR Designations
- Enemies
- Flexible Stats
- Game Base Variants
- Game Variants
- Impulses
- Map Variants
- Maps
- Medals
- Playlists
- Requisition Packs
- Requisitions
- Skulls
- Spartan Ranks
- Team Colors
- Vehicles
- Weapons
- Profile Endpoints
- Emblem Image
- Spartan Image
- Stats Endpoints
- Player Matches
- Arena Carnage Report
- Arena Service Record
- Campaign Carnage Report
- Campaign Service Record
- Custom Carnage Report
- Custom Service Record
- Warzone Carnage Report
- Warzone Service Record
- The Halo® Game Data API is still in a Beta period. Breaking changes are to be expected.
- Pull requests are welcome.
- If you see something or think something could be done better, shout out. I'm all ears.
- Review the HaloSharp.Test project for examples on each of the different endpoints and their usages.
- You'll need to provide your own API Key to run the test suite. (Setup.cs)
This application is offered by Damon Pollard, which is solely responsible for its content. It is not sponsored or endorsed by Microsoft. This application uses the Halo® Game Data API. Halo © 2015 Microsoft Corporation. All rights reserved. Microsoft, Halo, and the Halo Logo are trademarks of the Microsoft group of companies.