Using Github APIs to pull posts and to convert them to blog posts

less than 1 minute read

First, create a new personal access token to authenticate the api request. Otherwise, you will be hit by the rate limit.


Github has collections of restful APIs, very well-documented.

Get Repository Content

curl --location --request GET '' \

This will get the content as Base64String. I used a library, Refit, to call the api in C#

public interface IGithubApi
    Task<IApiResponse<IEnumerable<PostResponse>>> GetRepositoryContents(string owner,
        string repo,
        string path);

    Task<IApiResponse<IEnumerable<CommitResponse>>> ListCommits(string owner,
        string repo,
        string path);