# Shanghairanking — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access comprehensive rankings data for Chinese universities including ARWU, GRAS subject rankings, and BCUR assessments, with the ability to search institutions and view detailed university profiles. Compare academic performance metrics and subject-specific standings across China's higher education institutions.

**Category:** Education | **Website:** [shanghairanking.com/](https://shanghairanking.com/) | **Docs:** [parse.bot/marketplace/25c9fcb7-71b6-4dcf-bd1e-4410b565f032/shanghairanking-com-api](https://parse.bot/marketplace/25c9fcb7-71b6-4dcf-bd1e-4410b565f032/shanghairanking-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/shanghairanking/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get arwu rankings

Fetch ARWU (Academic Ranking of World Universities) world rankings for a given year. Returns a paginated list of ranked universities with their scores, world rank, national rank, and region. Supports optional filtering by region name. Single-page response ordered by world rank.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region` | string | No | Filter by full region name. Accepted values include: 'United States', 'China Mainland', 'China', 'United Kingdom', 'Germany', 'Italy', 'Australia', 'Japan', 'South Korea', 'Canada', 'France', 'Brazil', 'India', 'Taiwan, China', 'Sweden', 'Netherlands'. Empty string returns all regions. |
| `year` | string | No | Ranking year (e.g. '2024'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/shanghairanking/get-arwu-rankings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"region":"<string>","year":"<string>"}'
```

### Get chinese universities

Retrieve a list of Chinese universities with their current ARWU world ranking position. Each entry includes university name, slug identifier, world ranking, and region. The list is ordered by world ranking. Use the slug to fetch full university details via get_university_detail.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of universities to return. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/shanghairanking/get-chinese-universities \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>"}'
```

### Get gras subject rankings

Fetch GRAS (Global Ranking of Academic Subjects) rankings for a given year and subject code. Returns ranked universities with their scores for the specified academic subject. Each entry includes world rank, name, slug, region, and score. Single-page response ordered by subject rank.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `subject_code` | string | No | Subject code. Known codes: 'AS0210' (Computer Science & Engineering), 'AS0101' (Mathematics). |
| `year` | string | No | Ranking year (e.g. '2024'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/shanghairanking/get-gras-subject-rankings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"subject_code":"<string>","year":"<string>"}'
```

### Get university detail

Fetch the detailed profile of a specific university by its slug identifier. Returns name, website URL, founding year, physical address, and a list of subject rankings when available. The slug is obtainable from search_universities, get_arwu_rankings, or get_gras_subject_rankings endpoints.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | University slug identifier (e.g. 'tsinghua-university', 'harvard-university'). Obtainable from search_universities or ranking endpoints. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/shanghairanking/get-university-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### Search universities

Search universities by name substring and/or filter by region. Returns matching universities with their name, logo URL, slug, region, latest ranking info string, and current world ranking position. Results are not paginated — the full match set is returned.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | No | University name search query (substring match, e.g. 'Harvard', 'Tsinghua'). |
| `region` | string | No | Filter by region name. Accepted values include: 'China Mainland', 'China', 'United States', 'United Kingdom', 'Germany', 'Australia', 'Japan'. Empty string returns all regions. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/shanghairanking/search-universities \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","region":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.