# GitHub User repositories API (github.user_repositories)

- Canonical page: https://everyinfra.com/en/github-api/user_repositories
- Endpoint: POST /api/v1/social with {"platform": "github", "action": "user_repositories", "params": {...}}
- Price: $0.000958 per call ($0.96 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 30, max 30 per call
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=github&action=user_repositories

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | A GitHub username such as `torvalds`, or the profile link; organizations work too. |
| sort | enum: created / full_name / pushed / updated | no | not declared | Order of the list. `repository_issues`: created (default), updated or comments. `search_issues`: best match by default, or comments, created, updated, reactions. `forks`: newest (default), oldest, stargazers, watchers. `user_repositories`: created, updated, pushed, full_name. |
| limit | integer (1–30) | no | 30 | The most rows to return in this call, an integer from 1 to 30. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | GitHub's numeric ID, as a string. |
| full_name | Repository name as owner/repo; a renamed or transferred repository shows its new name. |
| name | Name of the object itself, for account, product and business capabilities. |
| owner_username | Username of the repository owner (user or organization). |
| owner_url | Profile link of the repository owner. |
| owner_avatar_url | Avatar image of the repository owner. |
| url | Link to the record on the platform. |
| description | Summary or description, usually shorter than text. |
| homepage | Project homepage set on the repository; absent when none is set. |
| language | Content language code (for example zh, en) as judged by the platform; it can be wrong. |
| license | License name, such as MIT License; absent when none is declared. Fork rows do not carry it. |
| topics | Repository topic tags; absent when there are none. |
| star_count | Stars. |
| fork_count | Forks. |
| open_issue_count | Open issues plus open pull requests, as GitHub counts them. |
| default_branch | Default branch name. |
| is_fork | Whether the repository itself is a fork (repository / user_repositories). |
| is_archived | Whether the repository is archived (read-only). |
| size_kb | Repository size in KB, as GitHub reports it. |
| created_at | Creation time, same format as posted_at. |
| updated_at | Last update time, ISO 8601 UTC. |
| pushed_at | Time of the last code push, ISO 8601 UTC. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "github",
  "action": "user_repositories",
  "params": {
    "username": "torvalds"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "github",
        "action": "user_repositories",
        "params": {
            "username": "torvalds",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "github",
  "action": "user_repositories",
  "results": [
    {
      "id": …,
      "full_name": …,
      "name": …,
      "owner_username": …,
      "owner_url": …,
      "owner_avatar_url": …,
      "url": …,
      "description": …,
      "homepage": …,
      "language": …,
      "license": …,
      "topics": …,
      "star_count": …,
      "fork_count": …,
      "open_issue_count": …,
      "default_branch": …,
      "is_fork": …,
      "is_archived": …,
      "size_kb": …,
      "created_at": …,
      "updated_at": …,
      "pushed_at": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=github
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
