# API: Rankings

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/rankings` | Public rankings: the most used models and the apps that send attribution headers, by tokens, over a day, a week or a month (no sign-in) | — |
| GET | `/v1/settings/rankings` | Whether your organization's traffic counts in the public rankings | `settings:read` |
| PUT | `/v1/settings/rankings` | Keep your organization's traffic out of the public rankings (owners). Agents may opt out; opting back in is done by a person. | `settings:write` |

## Examples

### GET /v1/rankings

Public rankings: the most used models and the apps that send attribution headers, by tokens, over a day, a week or a month. No sign-in, so it sends no key.

```bash
curl -s "https://manage.restolayer.com/v1/rankings"
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/rankings`, {
  method: "GET",
});
const data = await res.json();
```

### GET /v1/settings/rankings

Whether your organization's traffic counts in the public rankings

```bash
curl -s "https://manage.restolayer.com/v1/settings/rankings" \
  -H "Authorization: Bearer $LG_API_KEY"
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/settings/rankings`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/settings/rankings

Keep your organization's traffic out of the public rankings (owners). Agents may opt out; opting back in is done by a person.

```bash
curl -s -X PUT "https://manage.restolayer.com/v1/settings/rankings" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/settings/rankings`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

Request and response schemas: [https://www.restolayer.com/openapi.json](https://www.restolayer.com/openapi.json). All resources: [API reference](https://www.restolayer.com/docs/api).
