CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 00:51:26 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: 01K78C0JMRHEQ7WVX01ZVDJTMV-bom
Searching for repositories by topic using the GitHub GraphQL API | Simon Willison’s TILs
Searching for repositories by topic using the GitHub GraphQL API
I wanted to use the GitHub GraphQL API to return all of the repositories on the https://github.com/topics/git-scraping page.
At first glance there isn't a GraphQL field for that page - but it turns out you can access it using a GitHub search:
topic:git-scraping sort:updated-desc
An oddity of GitHub search is that sort order can be defined using tokens that form part of the search query!
Here's a GraphQL query tested here that returns the most recent 100 git-scraping
tagged repos, sorted by most recently updated.
{
search(query: "topic:git-scraping sort:updated-desc", type: REPOSITORY, first: 100) {
repositoryCount
nodes {
... on Repository {
nameWithOwner
description
updatedAt
createdAt
diskUsage
}
}
}
}
Related
- github Bulk fetching repository details with the GitHub GraphQL API - 2021-01-17
- graphql GraphQL fragments - 2022-09-30
- github Paginating through the GitHub GraphQL API with Python - 2020-07-09
- github Accessing repository dependencies in the GitHub GraphQL API - 2020-04-30
- graphql Using curl to run GraphQL queries from the command line - 2022-02-21
- clickhouse Reviewing your history of public GitHub repositories using ClickHouse - 2024-03-20
- graphql get-graphql-schema - 2022-02-01
- clickhouse Querying the GitHub archive with the ClickHouse playground - 2022-12-31
- fly Using the undocumented Fly GraphQL API - 2022-01-21
- hacker-news How to read Hacker News threads with most recent comments first - 2023-03-12
Created 2020-10-09T19:50:43-07:00 · Edit