Skip to content

Search Issues

GET /api/v5/search/issues

Call this endpoint to search issues by keyword; it returns an array of matching issue objects.

Access token support

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
q query string Yes Search keyword
page query integer No Current page number, maximum 100
per_page query integer No Number of items per page, maximum 50
sort query string No Sort field: created_at (creation time), last_push_at (update time); defaults to best match
order query string No Sort order, default desc
repo query string No Repository path
state query string No Filter issues by state: open, closed

Response parameters

Field Type Always returned Nullable Description
id integer Yes No Issue ID
html_url string Yes No HTML URL of the issue
number string Yes No Issue number
state string Yes No Issue state: open, closed
title string Yes No Issue title
body string Yes No Issue description body
repository object Yes No Information about the owning repository
created_at string Yes No Creation time
updated_at string Yes No Update time
labels array Yes Yes List of labels; the exact structure depends on the actual response
priority integer Yes No Priority
comments integer Yes No Number of comments
parent_id integer Yes No Parent issue ID

repository object

Field Type Always returned Nullable Description
repository.id integer Yes No Repository ID
repository.full_name string Yes No Full repository name (owner/name)
repository.human_name string Yes No Repository display name
repository.path string Yes No Repository path
repository.name string Yes No Repository name
repository.url string Yes No Repository URL
repository.owner object Yes No Repository owner information

repository.owner object

Field Type Always returned Nullable Description
repository.owner.avatar_url string Yes No User avatar URL
repository.owner.html_url string Yes No User homepage URL
repository.owner.id string Yes No User ID
repository.owner.login string Yes No Login name
repository.owner.name string Yes No User name
repository.owner.type string Yes No User type (for example, User)

Error responses

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Parameter q must not be empty",
  "field": "q"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The field names of the errors above depend on the actual backend response; if they cannot be confirmed, rely on the actual response.

HTTP status codes

Status code Description
200 Success (OK)
304 Not modified
401 Requires authentication
403 Forbidden
429 Too many requests
500 Internal server error

Request example

Parameter description

Replace <q> with the search keyword and <owner/repo> with the repository path (for example, owner/name). This endpoint allows anonymous access; no token is required. To authenticate, you can also send an AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/search/issues?q=<keyword>&repo=<owner/repo>&state=open&sort=created_at&order=desc&page=1&per_page=20' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/search/issues?q=<keyword>&repo=<owner/repo>&state=open&sort=created_at&order=desc&page=1&per_page=20", {
  headers: {
    "Accept": "application/json",
  },
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v5/search/issues",
    params={
        "q": "<keyword>",
        "repo": "<owner/repo>",
        "state": "open",
        "sort": "created_at",
        "order": "desc",
        "page": 1,
        "per_page": 20,
    },
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": 548499,
    "html_url": "https://api.atomgit.com/youlai/vue3-element-admin/issues/1",
    "number": "1",
    "state": "open",
    "title": "test",
    "body": "test",
    "repository": {
      "id": 3771502,
      "full_name": "youlai/vue3-element-admin",
      "human_name": "Youlai Open Source Organization / vue3-element-admin",
      "path": "vue3-element-admin",
      "name": "vue3-element-admin",
      "url": "https://api.atomgit.com/youlai/vue3-element-admin",
      "owner": {
        "avatar_url": "https://api.atomgit.com/avatar.png",
        "html_url": "https://api.atomgit.com/u013737132",
        "id": "6553a045ac27540b6bfcb436",
        "login": "u013737132",
        "name": "Youlai Tech",
        "type": "User"
      }
    },
    "created_at": "2024-11-07T18:11:23+08:00",
    "updated_at": "2024-11-07T18:11:23+08:00",
    "labels": [],
    "priority": 0,
    "comments": 0,
    "parent_id": 0
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credential)
400 Invalid parameters or the request cannot be parsed
404 Request path does not exist
405 Request method not supported
429 Too many requests; rate limit triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc