How should I get started with the GitHub API in C#?
Asked by
airflow.baffle.test
I'm following a backend development learning path and already know C#. One of the suggested beginner projects is to build something that displays GitHub user activity, so I'm trying to fetch data from GitHub's API.
I understand that C# applications commonly use HttpClient, a base address, and possibly authentication. I also know the general idea of calling GetAsync and deserializing the JSON response, but the GitHub documentation feels overwhelming and I'm not sure which endpoint, headers, or authentication method I should use first.
The project instructions only say to use the GitHub API without specifying an endpoint. Should I continue with this project now, or am I getting ahead of myself before learning more about APIs?
Answers
It would probably help to pause and work through a beginner-friendly C# REST API tutorial first. Knowing that HttpClient and GetAsync exist is a good start, but you also need to understand request URLs, query parameters, headers, response status codes, JSON models, async/await, and how authentication works. Once those pieces are familiar, GitHubโs documentation will be much easier to navigate.
Reply to this answer
The GitHub documentation is not especially beginner-oriented, and the project description sounds too vague if it only says to use the API. Start with one concrete goal, such as retrieving a userโs public events. Find the endpoint for that task, read its required parameters and response example, then make a simple GET request from C#. You can begin with public data and add authentication later if the API requires it or you run into rate limits.
this.seems.familiar: That makes sense. Instead of trying to understand the entire API, I should choose one endpoint and learn only what is needed to call it and interpret its response.
Reply to this answer
Add your answer
Answers are reviewed before publication.
airflow.baffle.test: I understand the basic GetAsync and JSON deserialization idea, but Iโm probably missing the bigger picture around requests and authentication. Iโll review those concepts before tackling GitHub specifically.