# Fix Transifex API pagination missing resources

## TL;DR

You are only reading the first page, so follow the pagination links until they run out. Transifex caps page size and will not warn you that more pages exist. Loop on the next link, collect every page, and your resource list becomes complete.

## The error

```text
GET /3/projects/{id}/resources returns 12 resources
the project actually has 47, the rest never appear
```

## Fix it

### Step 1: Request with an explicit page size and inspect the links

```bash
curl -s -H "your auth header "https://rest.api.transifex.com/resources?filter[project]=o:org:p:proj&page[size]=100" | head -c 400
```

Expected: The response includes pagination links with a next URL.

### Step 2: Loop until there is no next link

```bash
node -e "console.log('pattern: fetch page, push data, follow links.next, stop when links.next is null')"
```

Expected: You collect every page instead of just the first.

### Step 3: Count what you collected

```bash
node -e "console.log('compare collected count against the project dashboard total')"
```

Expected: The counts match.

### Step 4: Set the page size to the max to cut request count

```bash
node -e "console.log('use page[size]=100, the largest the API allows, to minimize pages')"
```

Expected: Fewer requests, same complete list.

## When to use this

- Transifex API returns fewer resources than the project has
- A sync silently skips resources

## When NOT to use this

- The count matches but some resources are wrong, that is a data issue
- The API errors, check auth and the endpoint

## Tool and version compatibility

- Transifex REST API v3, JSON:API pagination
- page[size] max 100

## Variant phrasings

### pagination on strings endpoint

Same loop. The strings endpoint paginates identically, and it is the one that usually hides missing data.

### cursor vs offset confusion

Transifex v3 uses link-following, not page numbers. Do not invent page=2, follow links.next.

## Why it happens

The API returns a fixed page size, default smaller than the max, and puts the rest behind links.next. Clients that parse only data and ignore links silently drop everything past page one.

## Edge cases

- Rate limits apply per page, add a small delay in big loops
- Filtering reduces pages, filter by project and updated-since where possible
- Cache the full list, do not re-paginate on every sync run

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_ceUG5Q8nUAxvtThMWZOJSg
