Anmelden

API-Nutzung

Fügen Sie &scraper=github-profile zu einem Crawling API-Request hinzu. URL-kodieren Sie die Ziel-URL im url-Parameter.

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://github.com/karpathy' \
  --data-urlencode 'scraper=github-profile' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://github.com/karpathy',
    {'scraper': 'github-profile'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://github.com/karpathy',
  { scraper: 'github-profile' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://github.com/karpathy', scraper: 'github-profile')
data = JSON.parse(res.body)

Beispiel-Eingabe-URL

Die im url-Parameter übergebene URL (zur besseren Lesbarkeit URL-dekodiert):

https://github.com/karpathy

Response-Struktur

JSON-Response-Body. Feldtypen können null sein, wenn die Quellseite den Wert nicht enthält.

name
string | null
Anzeigename.
username
string | null
Account-Login (der Profil-Slug).
bio
string | null
Profil-Bio.
url
string
Kanonische Profil-URL.
followers
integer | null
Anzahl der Follower.
following
integer | null
Anzahl der Following.
publicRepos
integer | null
Anzahl der öffentlichen Repositorys, die im Repositories-Tab angezeigt wird.
pinnedRepos
array
Namen der angehefteten Repositorys.
organizations
array
Logins der auf dem Profil angezeigten Organisationen.

Beispiel-Response

{
  "name": "Andrej",
  "username": "karpathy",
  "bio": "I like to train Deep Neural Nets on large datasets.",
  "url": "https://github.com/karpathy",
  "followers": 210000,
  "following": 8,
  "publicRepos": 63,
  "pinnedRepos": ["nanoGPT", "nanochat", "llm.c", "llama2.c", "micrograd", "microgpt"],
  "organizations": []
}