github-trendinglisted
Install: claude install-skill Makiya1202/ai-agents-skills
# GitHub Trending Data
Access GitHub trending repositories and developers data.
## Important Note
**GitHub does NOT provide an official trending API.** The trending page at `github.com/trending` must be scraped directly or use the GitHub Search API as an alternative.
## Approach 1: Direct Web Scraping (Recommended)
Scrape `github.com/trending` directly using Cheerio:
```typescript
import * as cheerio from 'cheerio';
interface TrendingRepo {
owner: string;
name: string;
fullName: string;
url: string;
description: string;
language: string;
languageColor: string;
stars: number;
forks: number;
starsToday: number;
}
async function scrapeTrending(options: {
language?: string;
since?: 'daily' | 'weekly' | 'monthly';
} = {}): Promise<TrendingRepo[]> {
// Build URL: github.com/trending or github.com/trending/typescript?since=weekly
let url = 'https://github.com/trending';
if (options.language) {
url += `/${encodeURIComponent(options.language)}`;
}
if (options.since) {
url += `?since=${options.since}`;
}
const response = await fetch(url, {
headers: {
'User-Agent': 'Mozilla/5.0 (compatible; TrendingBot/1.0)',
},
});
if (!response.ok) {
throw new Error(`Failed to fetch trending: ${response.status}`);
}
const html = await response.text();
const $ = cheerio.load(html);
const repos: TrendingRepo[] = [];
// Each trending repo is in an article.Box-row element
$('article.Box-row').each((_, element) =>