Skip to content

API Tools

GitHub API, HTTP requests, and search engine integrations.

9 modules

ModuleDescription
建立 GitHub Issue在 GitHub 儲存庫建立新的 Issue
Create GitHub Pull RequestCreate a new pull request in a GitHub repository
取得 GitHub 儲存庫取得 GitHub 儲存庫的資訊
列出 GitHub Issue列出 GitHub 儲存庫的 Issue
List GitHub RepositoriesList repositories for a GitHub user or the authenticated user
Google Search (API)Use Google Custom Search API to search keywords
HTTP GET RequestSend HTTP GET request to any URL
HTTP POST RequestSend HTTP POST request to any URL
Google Search (SerpAPI)Use SerpAPI to search keywords (100 free searches/month)

Modules

建立 GitHub Issue

api.github.create_issue

在 GitHub 儲存庫建立新的 Issue

Parameters:

NameTypeRequiredDefaultDescription
ownerstringYes-Repository owner
repostringYes-Repository name
titlestringYes-Issue title
bodytextNo-Issue description (Markdown supported)
labelsarrayNo-Issue labels
assigneesarrayNo-GitHub usernames to assign
tokenstringYes-GitHub Personal Access Token (required for creation)

Output:

FieldTypeDescription
statusstringOperation status (success/error)
issueobjectIssue information
numbernumberIssue or PR number
urlstringURL address

Example: Example

yaml
owner: myorg
repo: myproject
title: Bug: Login fails
body: Users cannot log in after the latest deployment.
labels: ["bug", "urgent"]

Create GitHub Pull Request

api.github.create_pr

Create a new pull request in a GitHub repository

Parameters:

NameTypeRequiredDefaultDescription
ownerstringYes-Repository owner
repostringYes-Repository name
titlestringYes-Pull request title
bodytextNo-Pull request description (Markdown supported)
headstringYes-The branch that contains your changes
basestringNomainThe branch you want to merge into
draftbooleanNoFalseCreate as draft pull request
tokenstringYes-GitHub Personal Access Token (required for creation)

Output:

FieldTypeDescription
statusstringOperation status (success/error)
probjectPull request information
numbernumberPull request number
urlstringPull request URL

Example: Example

yaml
owner: myorg
repo: myproject
title: Add user authentication
body: Implements OAuth2 login flow with Google and GitHub providers.
head: feature/auth
base: main

取得 GitHub 儲存庫

api.github.get_repo

取得 GitHub 儲存庫的資訊

Parameters:

NameTypeRequiredDefaultDescription
ownerstringYes-儲存庫擁有者(使用者名稱或組織)
repostringYes-儲存庫名稱
tokenstringNo-GitHub 個人存取權杖(選填但建議使用)

Output:

FieldTypeDescription
statusstring操作狀態
repoobject儲存庫資訊
namestring儲存庫名稱
full_namestring完整儲存庫名稱
descriptionstring儲存庫描述
starsnumber星星數量
forksnumberFork 數量
urlstring儲存庫網址

Example: Example

yaml
owner: octocat
repo: Hello-World

列出 GitHub Issue

api.github.list_issues

列出 GitHub 儲存庫的 Issue

Parameters:

NameTypeRequiredDefaultDescription
ownerstringYes-Repository owner
repostringYes-Repository name
stateselect (open, closed, all)NoopenIssue state filter
labelsstringNo-Filter by labels (comma-separated)
limitnumberNo30Maximum number of issues to fetch
tokenstringNo-GitHub Personal Access Token

Output:

FieldTypeDescription
statusstringOperation status (success/error)
issuesarrayThe issues
countnumberNumber of items

Example: Example

yaml
owner: facebook
repo: react
state: open
limit: 10

List GitHub Repositories

api.github.list_repos

List repositories for a GitHub user or the authenticated user

Parameters:

NameTypeRequiredDefaultDescription
ownerstringYes-GitHub username, or "me" for authenticated user
typeselect (all, owner, member)NoallFilter repositories by type
sortselect (created, updated, pushed, full_name)NoupdatedSort repositories by field
limitnumberNo30Maximum number of repositories to return
tokenstringNo-GitHub Personal Access Token (optional, required for private repos and "me")

Output:

FieldTypeDescription
statusstringOperation status (success/error)
reposarrayList of repositories
countnumberNumber of repositories returned

Example: Example

yaml
owner: octocat
sort: updated
limit: 10

Example: Example

yaml
owner: me
type: owner
sort: pushed

Google Search (API)

core.api.google_search

Use Google Custom Search API to search keywords

Parameters:

NameTypeRequiredDefaultDescription
keywordstringYes-Search keyword or query
limitnumberNo10Maximum number of results

Output:

FieldTypeDescription
statusstring操作狀態
dataarray搜尋結果資料
countnumber搜尋結果數量
total_resultsnumber總結果數

Example: Search Python tutorials

yaml
keyword: python tutorial
limit: 10

HTTP GET Request

core.api.http_get

Send HTTP GET request to any URL

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL to navigate to
headersobjectNo{}HTTP request headers as key-value pairs
paramsobjectNo{}URL query string parameters as key-value pairs
timeoutnumberNo30Maximum time to wait in seconds
verify_sslbooleanNoTrueVerify SSL certificates

Output:

FieldTypeDescription
status_codenumberHTTP 狀態碼
headersobject回應標頭
bodystring回應內容
jsonobjectJSON 回應(如果適用)

Example: Fetch API data

yaml
url: https://api.github.com/users/octocat

HTTP POST Request

core.api.http_post

Send HTTP POST request to any URL

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL to navigate to
headersobjectNo{}HTTP request headers as key-value pairs
bodystringNo-Text content to process
jsonanyNo-HTTP request body content (JSON, text, or form data)
timeoutnumberNo30Maximum time to wait in seconds
verify_sslbooleanNoTrueVerify SSL certificates

Output:

FieldTypeDescription
status_codenumberHTTP status code
headersobjectHTTP headers
bodystringResponse body content
jsonobjectParsed JSON response data

Example: Post JSON data

yaml
url: https://api.example.com/users
json: {"name": "John", "email": "john@example.com"}

Google Search (SerpAPI)

core.api.serpapi_search

Use SerpAPI to search keywords (100 free searches/month)

Parameters:

NameTypeRequiredDefaultDescription
keywordstringYes-Search keyword or query
limitnumberNo10Maximum number of results

Output:

FieldTypeDescription
statusstringOperation status (success/error)
dataarrayOutput data from the operation
countnumberNumber of items

Example: Search with SerpAPI

yaml
keyword: machine learning
limit: 10

Released under the Apache 2.0 License.