# github.issues

**stable** **Standard**

Recent issues (and PRs) of a GitHub repository.

`GET /v1/github/issues`

## What you get

A list of GitHub results in Onekey's unified shape, in `data` (an array). An empty array is a normal, successful answer and is charged like any other; a source that reports "nothing found" as an error returns a free `404 not_found` instead.

**Pagination:** 10 results per page. The response carries a `pagination` block; send its `next_cursor` back as the `cursor` parameter to get the next page. Every page is one call at the price below. See [Pagination](https://onekey.dev/docs/pagination.md).

**Also known as:** `/github/repo/issues` on APIs that nest their paths. See [Alternatives and equivalents](https://onekey.dev/docs/alternatives.md).

## What it costs

- **Standard · 1 credit** for a fresh fetch, charged only when it succeeds.
- **Free when served from cache (0.2 credit for a cached response over 100 KB).**
- **Free** if the request is invalid (never charged) or the source fails or reports not found (refunded).

## Parameters

| Name | Type | Required | Default | What it is | Constraints |
| --- | --- | --- | --- | --- | --- |
| `owner` | string | yes | (required) | GitHub user or organisation login | max 39 chars; must match `[a-z0-9](?:[a-z0-9-]{0,38})`; trimmed, leading @ removed, lowercased |
| `repo` | string | yes | (required) | Repository name | max 100 chars; must match `[a-z0-9_-][a-z0-9._-]{0,99}`; trimmed, lowercased |
| `cursor` | string | no | - | Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. | - |

## Request

```bash
curl "https://api.onekey.dev/v1/github/issues?owner=facebook&repo=react" \
  -H "x-api-key: YOUR_API_KEY"
```

```python
import requests

res = requests.get(
    "https://api.onekey.dev/v1/github/issues",
    params={"owner": "facebook", "repo": "react"},
    headers={"x-api-key": "YOUR_API_KEY"},
)
body = res.json()

if body["success"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
```

```javascript
const params = new URLSearchParams({ owner: "facebook", repo: "react" });
const res = await fetch(`https://api.onekey.dev/v1/github/issues?${params}`, {
  headers: { "x-api-key": "YOUR_API_KEY" },
});
const body = await res.json();

if (body.success) console.log(body.data);
else console.error(body.error.code, body.error.message);
```

## Recorded response

A real GitHub response, recorded and returned in Onekey's shape. Fields the platform does not provide are `null`.

```json
{
  "success": true,
  "data": [
    {
      "content": {
        "id": "37706",
        "title": "[DevTools Bug] Cannot remove node \"7321\" because no matching node was found in the Store.",
        "text": "### Website or app\n\nTrying to profile react page, got no matching node was found in the Store error\n\n### Repro steps\n\nIt's going to be hard without the website for someone to follow a set of steps to reproduce it. Sorry.\n\n### How often does this bug happen?\n\nEvery time\n\n### DevTools package (automated)\n\nreact-devtools-extensions\n\n### DevTools version (automated)\n\n8.0.0-1d34f91dfd\n\n### Error message (automated)\n\nCannot remove node \"7321\" because no matching node was found in the Store.\n\n### Error call stack (automated)\n\n```text\nat chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:538069\n    at _.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:490467)\n    at _.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:493013)\n    at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:492093\n    at nextBridgePortListener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:907981)\n```\n\n### Error component stack (automated)\n\n```text\n\n```\n\n### GitHub query string (automated)\n\n```text\nhttps://api.github.com/search/issues?q=Cannot remove node  because no matching node was found in the Store. in:title is:issue is:open is:public label:\"Component: Developer Tools\" repo:facebook/react\n```",
        "url": "https://github.com/react/react/issues/37706",
        "createdAt": "2026-09-28T18:17:17Z",
        "updatedAt": "2026-09-28T18:17:17Z",
        "state": "open"
      },
      "author": {
        "username": "gvidaver"
      },
      "engagement": {
        "comments": 0,
        "likes": 0
      }
    },
    {
      "content": {
        "id": "37705",
        "title": "Preserve SSR Suspense fallback across client re-suspend (#37620)",
        "text": "## Summary\r\n- Fixes https://github.com/react/react/issues/37620 (BountyHub `$100`): when `use(browser())` leaves a permanent SSR Suspense fallback and hydration re-suspends on a client-created promise (`setTimeout` / `localStorage` / IndexedDB shape), keep the dehydrated fallback DOM mounted instead of deleting and remounting an identical fallback.\r\n- Remounting restarted CSS animations (Progress) and dropped DOM state even though the visible UI looked unchanged.\r\n- Gate is tight to the recoverable `browser()` digest so ordinary error fallbacks still take the existing client-render path.\r\n\r\n## Implementation\r\nIn `updateDehydratedSuspenseComponent`, when a permanent fallback re-suspends on the client:\r\n1. Drop the dehydrated fragment from pending deletions.\r\n2. Mount a hidden primary Offscreen fiber for the retry.\r\n3. Reuse the existing dehydrated fallback sibling instead of creating a new fallback fragment.\r\n\r\nAlso teach `updateSuspenseFallbackChildren` / `bailoutOffscreenComponent` not to treat a preserved `DehydratedFragment` as renderable children.\r\n\r\n## Test plan\r\n- [x] `yarn test --build=false ReactDOMFizzServer-test` with browser-only / remount / SSR fallback patterns → **7 passed**\r\n- [x] New regression: client promise after `use(browser())` keeps the same span node identity across hydration\r\n- [x] Control: hydration that finishes without re-suspending still replaces the SSR fallback\r\n- [x] Multi-suspend: fallback identity preserved across sequential client promises\r\n\r",
        "url": "https://github.com/react/react/pull/37705",
        "createdAt": "2026-09-28T16:52:14Z",
        "updatedAt": "2026-09-28T17:06:44Z",
        "state": "open"
      },
      "author": {
        "username": "sidshehria"
      },
      "engagement": {
        "comments": 3,
        "likes": 0
      }
    }
  ],
  "metadata": {
    "platform": "github",
    "endpoint": "issues",
    "cached": false,
    "stale": false,
    "age_s": 0,
    "fetched_at": "2026-01-01T12:00:00+00:00",
    "credits_charged": 1,
    "request_id": "7f3a9c2e5b1d4c8fa2e6d0b9c4f18e37"
  },
  "error": null
}
```

## Field mapping

How this endpoint's source fields become Onekey's [unified schema](https://onekey.dev/docs/schema.md). Fields the source lacks come back as `null`.

| Source path | Onekey field | Transform |
| --- | --- | --- |
| `number` | `content.id` | `toString` |
| `title` | `content.title` | - |
| `body` | `content.text` | - |
| `html_url` | `content.url` | `safeUrl` |
| `created_at` | `content.createdAt` | `toIsoDate` |
| `updated_at` | `content.updatedAt` | `toIsoDate` |
| `state` | `content.state` | - |
| `user.login` | `author.username` | - |
| `comments` | `engagement.comments` | `toNumber` |
| `reactions.total_count` | `engagement.likes` | `toNumber` |

## Caching and freshness

- Fresh for about 2 minutes. Repeat calls in that window are served from cache and are free.
- Between 2 minutes and 15 minutes the cached copy is still served instantly and marked `stale: true` while Onekey refreshes it in the background.
- If the source is down when a refresh is needed, the last copy can be served for up to 1 hour more (marked stale).
- A "not found" is remembered for 1 minute and is free.
- The cache is shared across all customers, which is what keeps repeat calls cheap.

## What can go wrong

| Status | Code | What to do |
| --- | --- | --- |
| 401 | `unauthorized` | Check the `x-api-key` header. |
| 402 | `insufficient_credits` | [Add credits](https://onekey.dev/pricing); your balance must cover the price. |
| 404 | `not_found` | Unknown endpoint path. |
| 422 | `invalid_params` | Fix the parameters using the table above. Free. |
| 429 | `rate_limited` | Wait `Retry-After` seconds, then retry. |
| 502 | `upstream_error` | The source failed. Refunded; retry with backoff. |

See [Errors](https://onekey.dev/docs/errors.md) for the full list and retry guidance.

Status: stable (verified against the live source).
