Se connecter

Utilisation de l'API

Ajoutez &scraper=github-profile à une requête Crawling API. Encodez en URL l'URL cible dans le paramètre url.

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)

Exemple d'URL en entrée

L'URL passée dans le paramètre url (décodée pour plus de lisibilité) :

https://github.com/karpathy

Structure de la réponse

Corps de la réponse JSON. Les types de champs peuvent être null lorsque la page source omet la valeur.

name
string | null
Nom d'affichage.
username
string | null
Identifiant de connexion du compte (le slug du profil).
bio
string | null
Bio du profil.
url
string
URL canonique du profil.
followers
integer | null
Nombre de followers.
following
integer | null
Nombre de following.
publicRepos
integer | null
Nombre de dépôts publics affiché sur l'onglet Repositories.
pinnedRepos
array
Noms des dépôts épinglés.
organizations
array
Identifiants des organisations affichées sur le profil.

Exemple de réponse

{
  "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": []
}