# Star or Unstar a GitHub Repository API

> Star or unstar a repository as the supplied token's account. Idempotent in both directions. Bring your own GitHub token: a fine-grained PAT with the 'Starring' user permission (write) and 'Metadata' repository permission (read), or a classic PAT with 'public_repo' (broad, prefer fine-grained). The token is used for this one call, never stored; sent only to api.github.com.

Category: [Developer Tools APIs](https://upapi.io/apis/developer-tools) · Last updated 2026-11-07

## How to call it

- Endpoint: `POST https://api.upapi.io/github-repo-star.post`, key in the `X-Api-Key` header, JSON body.
- Cost: 1 weighted unit per call.
- Timeout: 30 seconds.
- Cache: none; every call runs the operation.
- Try it without writing code: https://app.upapi.io/try/github-repo-star.post

```bash
curl -X POST https://api.upapi.io/github-repo-star.post \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{ "repo": "playwright", "owner": "microsoft", "token": "example", "action": "star" }'
```

## Request parameters

- `repo` (string, required) — Repo name
- `owner` (string, required) — Repo owner (user or org)
- `token` (string, required) — GitHub token of the account that will star. Fine-grained PAT: 'Starring' user permission (write) + 'Metadata' repository permission (read); classic PAT: 'public_repo' ('repo' for a private repository; broad, prefer fine-grained). Used for this one call, never stored; sent only to api.github.com.
- `action` (enum) — star = PUT, unstar = DELETE. Both are idempotent.
- `proxyUrl` (string) — Optional proxy URL. Use the same one across related calls when the upstream expects a consistent IP.

## Response fields

- `action` (string, required)
- `status` (integer, required) — GitHub's status; 204 is its success for both directions
- `actedAt` (string, required)
- `rateLimit` (object, required) — The rate-limit headers GitHub returned on THIS response, surfaced so the caller
can pace itself instead of the operation sleeping on its behalf.
- `rateLimit.limit` (integer, required) — X-RateLimit-Limit: requests allowed per window
- `rateLimit.resetAt` (string, required) — X-RateLimit-Reset as an ISO-8601 UTC timestamp
- `rateLimit.resource` (string, required) — X-RateLimit-Resource: which bucket (core, search, graphql, ...)
- `rateLimit.remaining` (integer, required) — X-RateLimit-Remaining: requests left
- `rateLimit.resetEpoch` (integer, required) — X-RateLimit-Reset as unix seconds
- `repository` (string, required)

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "repo": "playwright",
  "owner": "microsoft",
  "token": "example",
  "action": "star"
}
```

```json
{
  "action": "example",
  "status": 1,
  "actedAt": "example",
  "rateLimit": {
    "limit": 5,
    "resetAt": "example",
    "resource": "example",
    "remaining": 1,
    "resetEpoch": 1
  },
  "repository": "example"
}
```

## Frequently asked questions

### How much does the Star or Unstar a GitHub Repository API cost per call?

Each call spends 1 weighted unit of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Star or Unstar a GitHub Repository API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Star or Unstar a GitHub Repository API responses cached?

No — every call runs the operation live; responses are not cached.

## More Developer Tools APIs

- [Get GitHub Repository](https://upapi.io/apis/developer-tools/github-repo)
- [List GitHub Repository Contributors](https://upapi.io/apis/developer-tools/github-repo-contributors)
- [List GitHub Repository Issues](https://upapi.io/apis/developer-tools/github-repo-issues)
- [Follow or Unfollow a GitHub User](https://upapi.io/apis/developer-tools/github-user-follow)
- [Post a GitHub Issue Comment](https://upapi.io/apis/developer-tools/github-issue-comment)
- [React to a GitHub Issue Comment](https://upapi.io/apis/developer-tools/github-comment-reaction)
- [Check a GitHub Account's Health](https://upapi.io/apis/developer-tools/github-account-health)
- [Get GitHub User](https://upapi.io/apis/developer-tools/github-user)
