This API provides various endpoints to interact with GitHubโs API for repository and Gist management.
/git?search={topic}&lang={language}
Description: Search for GitHub repositories based on a topic and an optional language.
Usage:
/git?search={topic}&lang={language}
.{topic}
with the topic you want to search for and {language}
(optional) with the programming language./git?search=python&lang=javascript
Possible Responses:
{
"code": 200,
"message": "First repository found",
"repository": {
"name": "user/repo",
"url": "https://github.com/user/repo"
}
}
{
"code": 404,
"message": "No repositories found for the given topic and language"
}
/git?newgist={filename}&code={code}&token={token}
Description: Create a new Gist on GitHub with the specified filename and code content.
Usage:
/git?newgist={filename}&code={code}&token={token}
.{filename}
with the name of the file to be created, {code}
with the code content, and {token}
with your GitHub personal access token./git?newgist=myfile.py&code=print("Hello, world!")&token=your_token_here
Possible Responses:
{
"code": 201,
"message": "Gist created successfully",
"gist_url": "https://gist.github.com/username/abcdef1234567890"
}
/git?read={filename}&repo={repository}&token={token}
Description: Read the content of a file from a GitHub repository.
Usage:
/git?read={filename}&repo={repository}&token={token}
.{filename}
with the name of the file to read, {repository}
with the name of the repository, and {token}
with your GitHub personal access token./git?read=myfile.py&repo=user/repo&token=your_token_here
Possible Responses:
{
"code": 200,
"content": "File content here..."
}
{
"code": 404,
"message": "File not found in the repository"
}
{
"code": 401,
"message": "Unauthorized access to the repository"
}
/git?write={data}&filename={filename}&repo={repository}&token={token}
Description: Write data to a file in a GitHub repository.
Usage:
/git?write={data}&filename={filename}&repo={repository}&token={token}
.{data}
with the content to write, {filename}
with the name of the file to write to, {repository}
with the name of the repository, and {token}
with your GitHub personal access token./git?write=NewContent&filename=myfile.py&repo=user/repo&token=your_token_here
Possible Responses:
{
"code": 200,
"message": "File updated successfully"
}
{
"code": 404,
"message": "File not found in the repository"
}
{
"code": 401,
"message": "Unauthorized access to the repository"
}
/git?append={data}&filename={filename}&repo={repository}&token={token}
Description: Append data to the end of a file in a GitHub repository.
Usage:
/git?append={data}&filename={filename}&repo={repository}&token={token}
.{data}
with the content to append, {filename}
with the name of the file to append to, {repository}
with the name of the repository, and {token}
with your GitHub personal access token./git?append=NewContent&filename=myfile.py&repo=user/repo&token=your_token_here
Possible Responses:
{
"code": 200,
"message": "File updated successfully"
}
{
"code": 404,
"message": "File not found in the repository"
}
{
"code": 401,
"message": "Unauthorized access to the repository"
}
/git?del={filename}&repo={repository}&token={token}
Description: Delete a file from a GitHub repository.
Usage:
/git?del={filename}&repo={repository}&token={token}
.{filename}
with the name of the file to delete, {repository}
with the name of the repository, and {token}
with your GitHub personal access token./git?del=myfile.py&repo=user/repo&token=your_token_here
Possible Responses:
{
"code": 200,
"message": "File deleted successfully"
}
{
"code": 404,
"message": "File not found in the repository"
}
{
"code": 401,
"message": "Unauthorized access to the repository"
}