The GitHub Readme Retriever APIs allow you retrieve the README.md
from any GitHub Repo.
Retrieve the README.md
file from any public GitHub Repository.
Request
The API request requires two parameters: ownerName
and repositoryName
:
ownerName
is the name of the GitHub user who owns the repositoryrepositoryName
is the name of the GitHub Repository
Both values be extracted from the GitHub repository's url:
https://github.com/{ownerName}/{repositoryName}
curl --request GET 'https://githubreadmeretriever.azurewebsites.net/api/GetReadme/{ownerName}/{repositoryName}'
Response
{
"readme": "string",
"repositoryName": "string",
"repositoryOwner": "string"
}
To retrieve this repo's README.md
, we'll use the following parameters:
- ownerName:
brminnick
- repositoryName:
GitHubReadmeRetriever
curl --request GET 'https://githubreadmeretriever.azurewebsites.net/api/GetReadme/brminnick/GitHubReadmeRetriever'
{
"readme": "<div class=\"header\" align=\"center\">\n <h1 align=\"center\">GitHub Readme Retriever</h1>\n</div>..."
"repositoryName": "GitHubReadmeRetriever",
"repositoryOwner": "brminnick"
}
Retrieve the README.md
file from all private and public GitHub Repositories owned by the user.
Request
The API request requires two parameters: ownerName
and token
:
ownerName
is your GitHub username / logintoken
is your Personal Access Token generated by following these steps
curl --request GET 'https://githubreadmeretriever.azurewebsites.net/api/GetReadmes/{ownerName}/{token}'
Response
[
{
"readme": "string",
"repositoryName": "string",
"repositoryOwner": "string"
}
{
"readme": "string",
"repositoryName": "string",
"repositoryOwner": "string"
}
]
To retrieve the README.md
for all of my repositories, we will use the following parameters:
- ownerName:
brminnick
- token:
debddf126115d5f193526a7f29fe980e525e497e
Note: This example is not using a real token. You can create your token by following these steps.
curl --request GET 'https://githubreadmeretriever.azurewebsites.net/api/GetReadmes/brminnick/debddf126115d5f193526a7f29fe980e525e497e'
[
{
"readme": "# AsyncAwaitBestPractices\n\n[![Build Status](https://brminnick.visualstudio.com/AsyncAwaitBestPractices/_apis/build/status/AsyncAwaitBestPractices-.NET%20Desktop-CI)](https://brminnick.visualstudio.com/AsyncAwaitBestPractices/_build/latest?definitionId=5)\n\n...",
"repositoryName": "AsyncAwaitBestPractices",
"repositoryOwner": "brminnick"
}
{
"readme": "<div class=\"header\" align=\"center\">\n <h1 align=\"center\">GitTrends: GitHub Insights</h1>\n</div>\n<p align=\"center\">\n <a href=\"https://twitter.com/GitTrendsApp\">\n...",
"repositoryName": "GitTrends",
"repositoryOwner": "brminnick"
}
{
"readme": "<div class=\"header\" align=\"center\">\n <h1 align=\"center\">GitHub Readme Retriever</h1>\n</div>...",
"repositoryName": "GitHubReadmeRetriever",
"repositoryOwner": "brminnick"
}
]
Cloud Backend
- .NET Core - an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub
- Azure Functions - a serverless compute service that lets you run event-triggered code without having to explicitly provision or manage infrastructure
- Azure Functions Dependency Injection - Azure Functions supports the dependency injection (DI) software design pattern, which is a technique to achieve Inversion of Control (IoC) between classes and their dependencies
- Polly + HttpClientFactory - the recommended approach for retries with exponential backoff is to take advantage of more advanced .NET libraries
- Refit + HttpClientFactory -
IHttpClientFactory
can be used in combination with third-party libraries such as Refit
👤 Brandon Minnick
- Twitter: @TheCodeTraveler
- Blog: https://codetraveler.io
- Github: @brminnick