Docs
View as Markdown

github.search_commits

stable Advanced

Search GitHub commits.

GET /v1/github/search_commits

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.

What it costs#

  • Advanced · 5 credits 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#

NameTypeRequiredDefaultWhat it isConstraints
qstringyes(required)Search querymax 200 chars; trimmed, repeated spaces collapsed
cursorstringno-Opaque cursor from a previous response's pagination.next_cursor. Omit for the first page.-

Request#

curl "https://api.onekey.dev/v1/github/search_commits?q=repo%3Atorvalds%2Flinux%20merge" \
  -H "x-api-key: YOUR_API_KEY"

Try it

Add your key to run this call right here. No key? Get one free. The key stays in this tab.

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": "1c34493df92146304e63cc51b9ca60fca847dd43",
        "text": "Merge branch 'net-mlx5-bridge-fix-remaining-switchdev-ownership-gaps-on-merged-eswitch'\n\nBernardo Soares says:\n\n====================\nnet/mlx5: Bridge, fix remaining switchdev ownership gaps on merged eswitch\n====================\n\nLink: https://patch.msgid.link/redacted@example.invalid\nSigned-off-by: Jakub Kicinski <redacted@example.invalid>",
        "url": "https://github.com/torvalds/linux/commit/1c34493df92146304e63cc51b9ca60fca847dd43",
        "createdAt": "2026-09-23T01:09:23Z"
      },
      "author": {
        "displayName": "Jakub Kicinski",
        "username": "kuba-moo"
      },
      "engagement": {
        "comments": 0
      },
      "entity": {
        "name": "torvalds/linux"
      }
    },
    {
      "content": {
        "id": "fc6d80eb504458d6416b75a94188b268c95c6533",
        "text": "tcp: prevent collapsing skbs across boundary in rtx queue\n\ntcp_write_collapse_fence() sets TCP_SKB_CB(skb)->eor = 1 on\ntcp_write_queue_tail(sk) to prevent skbs queued after a switch to\ndevice encryption from being collapsed into earlier skbs.\n\nThe fence is a no-op if all earlier data has already been transmitted\nwhen the switch happens: sk->sk_write_queue is empty. The not yet\nacknowledged earlier skbs wait in sk->tcp_rtx_queue with eor 0.\n\nOn a subsequent retransmit or SACK shift, tcp_retrans_try_collapse() or\ntcp_shift_skb_data() can then merge an skb queued after the switch into\none queued before it.\n\nBoth users of the fence are affected:\n\n- psp: devices only encrypt skbs with skb->decrypted set. The merged skb\n  keeps decrypted = 0 from the earlier skb, so merged data sent after\n  psp_sock_assoc_set_tx() is retransmitted in cleartext.\n\n- tls device offload: the merged skb straddles the start marker set in\n  tls_set_device_offload(). The software fallback (fill_sg_in() returns\n  -EINVAL) and the mlx5, nfp and funeth drivers cannot handle such an\n  skb and drop it. Every retransmit rebuilds the same skb, so the\n  connection stalls.\n\nFix this in two places, for defense in depth:\n\n1. Fall back to tcp_rtx_queue_tail(sk) in tcp_write_collapse_fence()\n   when tcp_write_queue_tail(sk) is NULL.\n\n2. Check !skb_cmp_decrypted(to, from) in tcp_skb_can_collapse(), as\n   tcp_skb_can_collapse_rx() does on receive. skb_shift(), which both\n   collapse paths call, already has a DEBUG_NET_WA",
        "url": "https://github.com/torvalds/linux/commit/fc6d80eb504458d6416b75a94188b268c95c6533",
        "createdAt": "2026-09-24T15:44:12Z"
      },
      "author": {
        "displayName": "Willem de Bruijn",
        "username": "wdebruij"
      },
      "engagement": {
        "comments": 0
      },
      "entity": {
        "name": "torvalds/linux"
      }
    }
  ],
  "metadata": {
    "platform": "github",
    "endpoint": "search_commits",
    "cached": false,
    "stale": false,
    "age_s": 0,
    "fetched_at": "2026-01-01T12:00:00+00:00",
    "credits_charged": 5,
    "request_id": "7f3a9c2e5b1d4c8fa2e6d0b9c4f18e37"
  },
  "error": null
}

Field mapping#

How this endpoint's source fields become Onekey's unified schema. Fields the source lacks come back as null.

Source pathOnekey fieldTransform
shacontent.id-
commit.messagecontent.text-
html_urlcontent.urlsafeUrl
commit.author.datecontent.createdAttoIsoDate
commit.author.nameauthor.displayName-
author.loginauthor.username-
commit.comment_countengagement.commentstoNumber
repository.full_nameentity.name-

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#

StatusCodeWhat to do
401unauthorizedCheck the x-api-key header.
402insufficient_creditsAdd credits; your balance must cover the price.
404not_foundUnknown endpoint path.
422invalid_paramsFix the parameters using the table above. Free.
429rate_limitedWait Retry-After seconds, then retry.
502upstream_errorThe source failed. Refunded; retry with backoff.

See Errors for the full list and retry guidance.

Status: stable (verified against the live source).