a simple Advent of Code API written in C# - also checkout the Rust version
dotnet add package AoCAPI
using AoC.API;
var client = new Session("session cookie", int year, int day); // Initializes a new Session instance
var client = new Session("session cookie", string input, Regex pattern); // Initializes a new Session instance
The Regex overload needs to have a regex group named "year" and a group named "day".
How to name Regex groups
How to obtain session cookie
string inputText = await client.GetInputTextAsync(); // Retrieves the input text of the AoC puzzle
string[] inputLines = await client.GetInputLinesAsync(); // Retrieves the input lines of the AoC puzzle
string sampleInputText = await client.GetSampleInputTextAsync(int nth); // Retrieves the nth sample input text of the AoC puzzle
string[] sampleInputLines = await client.GetSampleInputLinesAsync(int nth); // Retrieves the nth sample input lines of the AoC puzzle
Dictionary<int, int> achievedStars = await client.GetAllStarsAsync(); // Retrieves each year's number of stars earned (key: year, value: stars)
Response response = await client.SubmitAnswerAsync(int part, object answer); // Submits an answer to part 1 or 2 of the AoC puzzle. Returns a response type with a success status and a cooldown period
credits to:
Max - markdown info icons
Monday Morning Haskell - documentation on how to obtaining session cookie
Developer.Mozilla - documentation on how to name Regex groups