CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 08:42:21 GMT
server: Fly/6f91d33b9d (2025-10-08)
content-type: text/html; charset=utf-8
content-encoding: gzip
via: 2 fly.io, 2 fly.io
fly-request-id: 01K796YTR2J76PWZDC25ZQPNB0-bom
Bulk fetching repository details with the GitHub GraphQL API | Simon Willison’s TILs
Bulk fetching repository details with the GitHub GraphQL API
I wanted to be able to fetch details of a list of different repositories from the GitHub GraphQL API by name in a single operation.
It turns out the search()
operation can be used for this, given 100 repos at a time. The trick is to use the repo:
search operator, e.g repo:simonw/datasette repo:django/django
as demonstrated by this search.
Here's the GraphQL query, tried out using https://docs.github.com/en/graphql/overview/explorer
{
search(type: REPOSITORY, query: "repo:simonw/datasette repo:django/django", first: 100) {
nodes {
... on Repository {
id
nameWithOwner
createdAt
repositoryTopics(first: 100) {
totalCount
nodes {
topic {
name
}
}
}
openIssueCount: issues(states: [OPEN]) {
totalCount
}
closedIssueCount: issues(states: [CLOSED]) {
totalCount
}
releases(last: 1) {
totalCount
nodes {
tagName
}
}
}
}
}
}
Related
- github Searching for repositories by topic using the GitHub GraphQL API - 2020-10-09
- graphql GraphQL fragments - 2022-09-30
- github Paginating through the GitHub GraphQL API with Python - 2020-07-09
- graphql Using curl to run GraphQL queries from the command line - 2022-02-21
- github Accessing repository dependencies in the GitHub GraphQL API - 2020-04-30
- github Finding uses of an API with the new GitHub Code Search - 2022-12-08
- clickhouse Querying the GitHub archive with the ClickHouse playground - 2022-12-31
- google Limited JSON API for Google searches using Programmable Search Engine - 2023-09-16
- clickhouse Reviewing your history of public GitHub repositories using ClickHouse - 2024-03-20
- graphql get-graphql-schema - 2022-02-01
Created 2021-01-17T11:49:46-08:00 · Edit