# missing_param 422: why a parameter you sent reads as missing, and how to fix it

> Got HTTP 422 missing_param? 16 broken test calls show the 3 causes: wrong name, no array, empty params. Fixed call and cost: $5.556 per 1,000 items.

- Canonical page: [https://everyinfra.com/en/blog/missing-param-422-error](https://everyinfra.com/en/blog/missing-param-422-error?utm_medium=ai_doc&utm_campaign=page_md)
- Published: 2026-12-03T01:40:21+08:00 · Fact-checked: 2026-12-03T01:26:00+08:00

An HTTP 422 with `"code": "missing_param"` means the gateway did not find a required parameter inside `params`. EveryInfra is the data API we build and sell. In our tests it returned this error for three reasons: a wrong name, a single value outside an array, or an empty `params` object. The fix is to use the catalog name `urls` and send an array. The capability in this test is [`xianyu/item_detail`](/xianyu-api/item_detail), which returns product details from Xianyu, a second-hand marketplace in China (web domain goofish.com).

It accepts only `urls`, so `item_id` and `url` both count as "not sent". On 2026-12-03, between 00:12 and 00:31 Singapore time (SGT), we sent 16 broken requests on purpose. All 16 returned 422, and every error body ended with "Nothing was charged." The corrected request for one product cost $0.005556.

1. We copied a customer ticket from 2026-11-20 ("passing the ID does not work, passing the link does not work either") and sent `item_id` and `url`. Both returned `missing_param`, and `next_steps` named the wrong key.
1. We sent the link as a plain string, an empty array and the same item twice. We also sent an item with `]}}` at the end. All four returned `missing_param`. Except for the empty array, each one had a shape hint in brackets.
1. We moved `urls` out of `params`, sent `params` as a string, added one extra `}`, and dropped the JSON header. These returned `unknown_param` (with `did_you_mean: ["params.urls"]`) and three kinds of `validation_error`.
1. We sent `"urls": ["https://www.goofish.com/item?id=1101624362349"]` and got HTTP 200, one item and `charged_usd` 0.005556. Two items in one array (one ID, one link) cost 0.011111.

> **Key points**
>
> - 16 broken requests: `missing_param` 9, `unknown_param` 3, `validation_error` 3, `invalid_value` 1. All were HTTP 422 with `retryable: false`, and each body said "Nothing was charged."
> - The same wrong key `item_id` gives two codes. Without `urls` it is `missing_param`. With a correct `urls` plus `item_id` it is `unknown_param`, with `allowed: ["urls","limit"]`. The catalog does not list `limit`.
> - In `80: JSON decode error`, 80 is the position of the bad character. Python `json.loads` and Node `JSON.parse` report position 80 for the same body.
> - After the fix, `xianyu/item_detail` bills per item: $5.556 per 1,000 items, or about $33.33 for 200 items a day over 30 days.

## What does a 422 missing_param error mean?

It means the request syntax was fine and the key was valid, but the capability did not get a required parameter. The gateway stops before it runs the job and returns HTTP 422. The HTTP standard [RFC 9110, section 15.5.21](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.21) defines 422 like this. The server understands the content type and the syntax is correct, but it cannot process the instructions. That matches a missing parameter. The body is valid JSON, and `platform` and `action` are known, but something is not in `params`.

[MDN's 422 page](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422) says that a client that gets a 422 should expect the same error if it repeats the request without a change. Our 16 test bodies agree. Each one has `"retryable": false` and `"fault": "request"`. The fix is a change to the request. A retry loop does not help.

Every EveryInfra 422 body sits inside an `error` object. The `code` is the machine-readable error code. The `message` is one English sentence. The `param` names the parameter. The `catalog_url` points to the free parameter catalog for that platform.

The `next_steps` array tells you what to change. The `request_id` lets us find the call in our logs. `missing_param` is one of four codes that share the 422 status. The others are `unknown_param`, `invalid_value` and `validation_error`. Each code has a different fix, so read the code first and the status second.

![Diagram of a real 422 body with labels on each line. The code line says error code missing_param. The message line says the brackets show the shape urls needs, an array of item IDs or goofish.com item links. The param line says the parameter at fault is urls. The catalog_url line says look up parameters here. The retryable line says false, a resend without a change will fail again. The next_steps line says what to change, ending with Nothing was charged.](https://everyinfra.com/articles/missing-param-422-error/fig-01-error-anatomy.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

## What are the three most common causes, and how do I spot each one?

We sorted the `missing_param` cases from the customer ticket and our test calls into three groups. You can spot each group in the error body. In group one, the name is wrong, and `next_steps` contains "`xxx` is not a parameter here", where `xxx` is the name you sent. In group two, the value has the wrong shape, and the `message` has a hint in brackets, such as `urls(array of item IDs or goofish.com item links)`. In group three, `params` is empty, the key is absent, or `urls` is an empty array. Then `next_steps` only says "Add the required `urls`." with no wrong name and no brackets.

| Cause | How to spot it in the body | Test calls | Fix |
| --- | --- | --- | --- |
| Wrong name (`item_id`, `url`, typo `keywrod`) | `next_steps`: "`item_id` is not a parameter here" | e1, e2, u2 | Use the catalog name, `urls` or `keyword` |
| Single value not in an array, duplicate, extra characters in a value | Brackets in `message`: `array of item IDs…`, `each item at most once`, `each entry must be a numeric item ID…` | e3, e10, w1, w2 | `"urls": ["<ID or link>"]`, even for one item |
| Empty `params`, no key, or an empty `urls` array | `next_steps`: "Add the required `urls`." and no brackets in `message` | e5, e6 | Add `urls` inside `params`. For an empty array, check the source data, such as a blank spreadsheet cell |

The other three 422 codes are easy to spot too. `unknown_param` always carries `allowed`. `invalid_value` always carries `did_you_mean` and `allowed`. `validation_error` has no `param` field, and its `message` describes a problem with the JSON structure.

![Flowchart. After an HTTP 422, read error.code. missing_param splits three ways: if next_steps says is not a parameter here, fix the name. If message has brackets, fix the value shape. Otherwise add the required parameter to params. unknown_param leads to remove the key or move it into params, then check allowed and did_you_mean. invalid_value leads to pick a value from allowed. validation_error leads to check that the body is valid JSON, params is an object, and Content-Type is application/json. Every branch ends at send again.](https://everyinfra.com/articles/missing-param-422-error/fig-02-fix-flow.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

## Cause 1: why does a wrong name like item_id or url show up as "missing"?

The gateway checks required parameters first. It does not find `urls`, so it returns `missing_param`, and it names the key you sent in `next_steps`. At 00:12:41 SGT we sent `{"item_id": "1101624362349"}` to `xianyu/item_detail`. The reply was `missing required param: urls`. The next step read: "Add the required `urls` (`item_id` is not a parameter here). Nothing was charged." In the same second we sent `{"url": "https://www.goofish.com/item?id=1101624362349"}` and got the same body with `url` as the wrong name.

This is what happened to the customer in the ticket. The ID was correct, and the link was correct too. The parameter name was the problem. This capability wants the plural `urls`.

Both wrong names have a source. At 00:12:29 SGT we ran `xianyu/search` for "iPhone 13" to get test items. In each search result, the field for the item ID is `item_id`, with the string value "1101624362349". Next to it, a `url` field holds the item link.

The catalog note for the search field `item_id` says that you can put it directly into the `urls` of item_detail. So put the values of these fields into the `urls` array, and do not use the field names as parameter names. The customer used `item_id` for the ID and `url` for the link, which are exactly the search field names.

```bash
# Wrong: the key is item_id (e1, 2026-12-03 00:12:41 SGT)
curl -s https://api.everyinfra.com/api/v1/social \
  -H "Authorization: Bearer $EVERYINFRA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"xianyu","action":"item_detail","params":{"item_id":"1101624362349"}}'

# Response (HTTP 422)
{"error":{"code":"missing_param","message":"missing required param: urls",
 "request_id":"req_41d09a9727c74bf5","param":"urls",
 "catalog_url":"/api/v1/social/catalog?platform=xianyu",
 "fault":"request","retryable":false,
 "next_steps":["Add the required `urls` (`item_id` is not a parameter here). Nothing was charged."]}}
```

The same wrong key can produce a different code. At 00:13:37 SGT we sent a correct `urls` and also an extra `item_id`. The required parameter was now present, so the gateway returned `unknown_param`. The message said that `item_id` is not a parameter of xianyu/item_detail, with "Required: urls. Optional: limit." The body also had `allowed: ["urls","limit"]`, and the next step was "Remove `item_id`". The catalog lists only the required `urls` for `xianyu/item_detail` and no optional parameters.

So `limit` appears only in the error body. At 01:26 SGT we sent `{"urls": ["1101624362349"], "limit": 5}` as a follow-up test. It returned HTTP 200 with one item and charged $0.005556. The gateway accepted `limit`, but the catalog does not say what it does for item details. With one item, we saw no difference.

So `missing_param` tells you to add something, and `unknown_param` tells you to remove something.

The search capability follows the same rule. At 00:13:21 SGT we sent the typo `keywrod` to [`xianyu/search`](/xianyu-api/search). The reply was `missing required param: keyword`, and `next_steps` said "`keywrod` is not a parameter here". The body also had a working `example`: `{"platform":"xianyu","action":"search","params":{"keyword":"iPhone 15"}}`. In the same second we sent a correct `keyword` plus an unknown `keywords_per_page`.

That returned `unknown_param`, and the message listed "Required: keyword. Optional: limit." with an `example` again. When the body has an `example`, copy it and change the values. That request will pass validation.

[GitHub's REST troubleshooting guide](https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api) says the same thing about its own API. A missing required parameter or a wrong type can return 422 with "Invalid request". The guide tells you to check the reference docs for each endpoint. Names differ between APIs.

One API uses `id`, another uses `item_id`, and a third takes a single `url`. In our catalog, the required names for each capability are in `required_params`. For Xianyu item details there is one name: `urls`.

## Why are item_id and url such common mistakes?

In our own catalog, `url` is the most common required name, so habits from other capabilities break on this one. We counted every capability in the full catalog that we read at 00:12 SGT on 2026-12-03. There are 804 capabilities on 113 platforms. The required name `url` appears 222 times, `keyword` 191 times, `username` 102 times and `item_id` 6 times. The plural `urls` appears only 10 times. If you used single-item detail capabilities on other platforms first, your hands probably type `url`.

27 capabilities have a required parameter of type array, and every one of those names is plural. The counts are `urls` 10, `app_ids` 4, `usernames` 3, `keywords` 2 and `asins` 2. `place_ids`, `slugs`, `comment_ids`, `comment_urls`, `channels` and `user_ids` appear once each. Most of these capabilities have `_batch` in the name, such as `douyin/posts_batch`, `twitter/profiles_batch` and `xiaohongshu/comments_batch`. `xianyu/item_detail` and `instagram/post` take an array but do not say "batch" in the name. That makes them easier to get wrong.

The catalog also has 8 pairs where both the singular and the plural exist. Four of them are `url` and `urls`, `username` and `usernames`, `keyword` and `keywords`, and `user_id` and `user_ids`. The other four are `app_id` and `app_ids`, `asin` and `asins`, `channel` and `channels`, and `comment_id` and `comment_ids`. One missing or extra "s" triggers `missing_param` when you switch between these capabilities.

So the rule is simple. Trust the `required_params` of the capability you call, and do not guess from the name. 698 of the 804 capabilities have exactly one required parameter, so you usually check one name only.

![Horizontal bar chart of the most common required parameter names across 804 catalog capabilities: url 222, keyword 191, username 102, user_id 35, company 11, comment_id 10, urls 10, app_id 8, douyin_id 7, item_id 6. The urls bar is teal with a note: array type, the one Xianyu item details uses.](https://everyinfra.com/articles/missing-param-422-error/fig-08-required-names-bar.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

| Required name | Capabilities in the catalog | Type |
| --- | --- | --- |
| `url` | 222 | string |
| `keyword` | 191 | string |
| `username` | 102 | string |
| `item_id` | 6 | string |
| `urls` | 10 | array |
| Any array-type required name | 27 | array |

## Cause 2: why must a single item go inside an array?

The `urls` parameter of `xianyu/item_detail` is an array that takes 1 to 20 items, so one item must also be written as `["…"]`. The catalog text says this: an array of Xianyu items, 1 to 20 per call. Each entry is a numeric item ID or a `https://www.goofish.com/item?id=<digits>` link, and each item can appear only once. Billing is per item, items that we cannot fetch are refunded per item, and app share short links are not accepted.

We read this in the [Xianyu catalog](https://api.everyinfra.com/api/v1/social/catalog?platform=xianyu) at 00:12 SGT. Multi-target capabilities share this design. Their names are mostly plural, such as `urls`, `targets`, `usernames` and `tickers`, and they bill by the number of entries.

At 00:12:42 SGT we sent the link as a string: `"urls": "https://www.goofish.com/item?id=1101624362349"`. The `message` was `missing required param: urls(array of item IDs or goofish.com item links)`. The text in brackets is the answer. The gateway wants an array, and each element is an item ID or a Xianyu item link.

Note one detail here. A `urls` value with the wrong shape counts as "no usable `urls`", so the code stays `missing_param`. There is no separate type error code. Always read the brackets in `message`, not only the `code`.

Bad content inside the array uses the same code. At 00:13:00 SGT an empty array `"urls": []` returned `missing required param: urls`, the same as no key at all. At 00:13:21 SGT the same item twice returned `urls(each item at most once)`. At 00:30:48 SGT we copied the ticket case and pasted `"]}}` into the ID: `["1101624362349\"]}}"]`.

The reply was `urls(each entry must be a numeric item ID or https://www.goofish.com/item?id=<digits>)`. At 00:30:57 SGT we pasted `]}}` at the end of a link and got the same sentence. Four inputs gave one code and four different hints, and each hint points to the part you must change.

We also found one behavior that the catalog does not describe. At 00:13:00 SGT we sent the ID as a number inside the array, `"urls": [1101624362349]`. The gateway accepted it, returned HTTP 200 with one item, and charged $0.005556. The catalog says "numeric item ID" and does not say if quotes are needed. This test shows that a number works today, but the catalog does not promise it.

We recommend strings. Xianyu IDs have 13 digits. A JavaScript number is exact up to about 16 digits, so this is safe now. If IDs get longer, a string is still not affected.

![EveryInfra illustration. On the left a single product card is stopped at a gate. On the right the same card sits in the first slot of a tray with several slots, and the tray passes through the gate. The other slots are empty.](https://everyinfra.com/articles/missing-param-422-error/img-array-tray.webp?utm_medium=ai_doc&utm_campaign=page_md)

One item still goes into an array. The gateway accepts a tray of items, and a loose card fails validation. [EveryInfra illustration based on the Xianyu item details catalog entry](https://api.everyinfra.com/api/v1/social/catalog?platform=xianyu)

## Cause 3: what happens if params is empty, a string, or at the wrong level?

The code depends on the mistake. An empty object returns `missing_param`, a key at the top level returns `unknown_param`, and a `params` value that is not an object returns `validation_error`. At 00:12:42 SGT we sent `"params": {}`. The reply was `missing required param: urls`, and the only next step was "Add the required `urls`." This is the plain case.

The name is not wrong, it is just absent. In code, an empty variable often serializes to an empty object. An example is a blank cell in a spreadsheet of item IDs.

In the same second we put `urls` at the top level of the body, next to `platform` and `action`, with no `params` object. The reply was `unknown_param`. The `message` printed the correct structure: `` `urls` goes inside `params`, not at the top level of the body: {"platform": "xianyu", "action": "item_detail", "params": {..., "urls": ["1101624362349"]}}. Top-level fields are platform, action, params, mode ``. The body also had `did_you_mean: ["params.urls"]` and `allowed: ["platform","action","params","mode"]`.

The top level accepts these four fields only. Everything else goes inside `params`. Here `next_steps` said "Move `urls` into `params` (did_you_mean `params.urls`), then resend." Both `candidates` and `did_you_mean` were `["params.urls"]`. To fix this in code, read the path in `did_you_mean` and move the key into the level before the dot.

At 00:13:20 SGT we sent `params` as a query string: `"params": "urls=1101624362349"`. This time the reply was `validation_error` with `params: Input should be a valid dictionary`. There was no `param` field and no `did_you_mean`. The gateway stopped at the body structure, before it checked the parameters of the capability. The `type` of a `validation_error` is `invalid_request`, and `next_steps` only says "Change the request as the message says". The prefix `params:` in the message tells you which level failed.

| Body | HTTP | `code` | `param` present | Helper fields |
| --- | --- | --- | --- | --- |
| `"params": {}` | 422 | `missing_param` | Yes (urls) | `next_steps` |
| `urls` at the top level | 422 | `unknown_param` | Yes (urls) | `did_you_mean`, `allowed`, `candidates` |
| `"params": "urls=…"` | 422 | `validation_error` | No | `message` only |
| One extra `}` in the body | 422 | `validation_error` | No | `message`: `80: JSON decode error` |
| No `Content-Type: application/json` | 422 | `validation_error` | No | `message`: `Input should be a valid dictionary or object to extract fields from` |

## What does the number in "JSON decode error" mean?

When `message` says `80: JSON decode error`, 80 is the position of the first bad character in the body, counted from 0. At 00:13:20 SGT we added one extra `}` to the end of a correct body. This copies the case where `]}}` gets pasted along with a value. The body had 81 characters, and character number 81 (position 80) was the extra `}`.

To confirm the meaning, we parsed the same text on our own machine. Python 3.15 `json.loads` reported `Extra data: line 1 column 81 (char 80)`. Node 26 `JSON.parse` reported `Unexpected non-whitespace character after JSON at position 80`. All three numbers match.

The JSON grammar in [RFC 8259, section 2](https://www.rfc-editor.org/rfc/rfc8259.html#section-2) says that a JSON text is one value with optional white space around it. Any other character after that value makes the text invalid. [MDN lists the `JSON.parse` errors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/JSON_bad_parse) of this kind, and they all start with `SyntaxError: JSON.parse:`. You can check the body locally before you send anything. The [Python json module](https://docs.python.org/3/library/json.html) has a command-line tool. `python -m json.tool body.json` prints the line, column and character position of a bad body ([command-line interface](https://docs.python.org/3/library/json.html#json-commandline)).

![Diagram of the 81-character request body from test e9 on one line, with character positions marked every 10 characters from 0. The last character, an extra closing brace at position 80, is circled in teal. Three labels point to it: EveryInfra message 80: JSON decode error, Python Extra data char 80, Node position 80.](https://everyinfra.com/articles/missing-param-422-error/fig-09-json-offset.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

A missing JSON header is another common case. At 00:31:02 SGT we used curl `-d` with the same correct body but without `-H "Content-Type: application/json"`. In this case curl sends form encoding by default. The reply was `validation_error` with `Input should be a valid dictionary or object to extract fields from`.

[Pulsetic's 422 guide](https://pulsetic.com/errors/422-unprocessable-content/) says that a wrong `Content-Type` can make every required field look missing. Our gateway does not report this as `missing_param`. It reports `validation_error`, so the code tells you to check the body format, not the parameter names.

Since curl 7.82.0, the `--json` option replaces three flags in one: `--data-binary`, `Content-Type: application/json` and `Accept: application/json` ([everything curl, JSON](https://everything.curl.dev/http/post/json.html)). Use `--json` when you type curl by hand, and the header is always there.

## What does the gateway return when ]}} gets into the array?

With `]}}` inside an ID or a link, the gateway returns `missing_param` with "each entry must be a numeric item ID or https://www.goofish.com/item?id=<digits>". With one extra `}` in the whole body, it returns `validation_error` and a position. The w1 and w2 replies are identical, so the gateway does not care where `]}}` sits. It only sees an entry that is not a valid ID or link.

The 2026-11-20 ticket said, in translation from Chinese, "passing the ID does not work, passing the link does not work either". The screenshot in the ticket showed `]}}` in the array field after the link. It looks like the customer copied JSON from somewhere else and took the closing brackets too. Each entry in `urls` holds only the ID or the link, with no `[`, `]`, `"` or `}`.

Looking back at the ticket, three steps get you from symptom to cause, and each step uses a field in the error body. First, read `code`. Both the ID and the link returned `missing_param`, so the required parameter was not found either time, and the values were not the problem. Second, read `next_steps`.

If it says "`item_id` is not a parameter here", fix the name to `urls`. If `message` has brackets, fix the shape. Third, compare with the example request on the capability page and confirm that `urls` is an array that holds only IDs or links.

The parameter text and the example request for Xianyu item details are on the [Xianyu item details API](/xianyu-api/item_detail) page. The example request there already writes `urls` as an array. The other capabilities on this platform are [Xianyu keyword search](/xianyu-api/search) and the seller item list, and the [Xianyu API](/xianyu-api) overview lists all fields. If you are still choosing a data source, our [Xianyu data API guide](/blog/xianyu-data-api-recommendation) from 2026-11-25 compares the options.

![Screenshot of the urls parameter text on the Xianyu item details API page. It says an array of Xianyu items, 1 to 20 per call. Each entry is a numeric item ID or an item link, and each item appears only once. A teal box marks this text and the example request below it.](https://everyinfra.com/articles/missing-param-422-error/img-item-detail-page.en.webp?utm_medium=ai_doc&utm_campaign=page_md)

The parameter text and example request on the capability page, with urls as an array. [EveryInfra Xianyu item details API page, screenshot taken 2026-12-03 SGT](https://everyinfra.com/xianyu-api/item_detail?utm_medium=ai_doc&utm_campaign=page_md)

## How do I read each field in the error body?

Every EveryInfra 422 body has `code`, `message`, `request_id`, `fault`, `retryable` and `next_steps`. Other fields depend on the error type. Read them in this order: `code`, `param`, `message`, `next_steps`, then `did_you_mean`, `allowed` and `example` if they are there. In our 16 broken requests, `param` and `catalog_url` are absent only for `validation_error`, and `did_you_mean` appears only twice:

| `code` | Count | When it appears | `param` | `catalog_url` | `did_you_mean` | `allowed` | `example` |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `missing_param` | 9 | Required parameter absent or unusable | 9/9 | 9/9 | 0/9 | 0/9 | 1/9 (search) |
| `unknown_param` | 3 | Unknown key, or key at the wrong level | 3/3 | 3/3 | 1/3 (wrong level) | 3/3 | 1/3 (search) |
| `invalid_value` | 1 | Enum value not allowed | 1/1 | 1/1 | 1/1 | 1/1 | 0/1 |
| `validation_error` | 3 | Body not valid JSON, `params` not an object, no JSON header | 0/3 | 0/3 | 0/3 | 0/3 | 0/3 |

`catalog_url` is the relative path `/api/v1/social/catalog?platform=xianyu`. Put `https://api.everyinfra.com` in front of it and you get the free parameter catalog for the platform, with no key needed. `did_you_mean` appears only when the gateway can guess what you meant. It suggests `params.urls` for a key at the wrong level and the closest valid values for a wrong enum. For a wrong name like `item_id` there is no `did_you_mean`, because `item_id` and `urls` look too different.

The gateway uses "is not a parameter here" in `next_steps` instead. `allowed` holds the names or values that the gateway accepts at that level. If it does not match the catalog, trust the catalog. For example, the `allowed` list for `xianyu/item_detail` has a `limit` that the catalog does not list.

`next_steps` is an array. It usually has one sentence, and `invalid_value` has two. At 00:13:21 SGT we sent `sort: "hot"` to [`reddit/search`](/reddit-api/search). The first sentence was "Change only `sort` to a value in `allowed`, then resend. Nothing was charged."

The second sentence covered the case where `catalog_url` lists the value you sent. Then the bug is on the EveryInfra side, and you can open a support ticket (`POST /api/v1/support/tickets`, category integration). This gives a clear test. If the catalog lists your value and the gateway rejects it, we must fix it. If the catalog does not list it, you must change the request.

![Heat map. Columns are six fields: param, catalog_url, did_you_mean, allowed, example, next_steps. Rows are the 16 broken requests grouped by code. The 9 missing_param rows all have param, catalog_url and next_steps, and only row u2 has example. The 3 unknown_param rows all have allowed, only row e4 has did_you_mean, and only row u1 has example. The invalid_value row has every field except example. The 3 validation_error rows have next_steps only.](https://everyinfra.com/articles/missing-param-422-error/fig-04-fields-heat.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

## What does the fixed call return?

With `urls` as the name and an array as the value, `xianyu/item_detail` returns HTTP 200. `results` holds the item details, `count` is the number of items, and `billing.charged_usd` is the charge for the call. At 00:14:47 SGT we sent one item link and got one item back. It was a 256 GB iPhone 13 listed at CNY 1,458 with free shipping (`shipping_fee` 0) and `condition_level` 9, which means 90 percent new. It had `want_count` 3 and `view_count` 102, it was posted on 2026-11-24, and the call charged $0.005556.

The response also has seller fields such as the seller name and profile link. We do not show them here. The `billing.units` field appears only when you send more than one item. It was 2 in ok2, and ok1 and e12 did not have it. So base your reconciliation code on `count` and `charged_usd`.

```bash
# Fixed: urls is an array (ok1, 2026-12-03 00:14:47 SGT)
curl -s https://api.everyinfra.com/api/v1/social \
  -H "Authorization: Bearer $EVERYINFRA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform":"xianyu","action":"item_detail","params":{"urls":["https://www.goofish.com/item?id=1101624362349"]}}'

# Response (HTTP 200, shortened)
{"id":"req_43e26e11cdcf4906","platform":"xianyu","action":"item_detail",
 "results":[{"item_id":"1101624362349","url":"https://www.goofish.com/item?id=1101624362349",
   "price":1458,"currency":"CNY","shipping_fee":0,"condition_level":9,
   "want_count":3,"view_count":102,"posted_at":"2026-11-24T10:28:34+00:00", "...": "..."}],
 "count":1,
 "billing":{"charged":true,"charged_usd":0.005556,"amount":{"per_1k":{"USD":5.555556}}}}
```

At 00:15:10 SGT we put one numeric ID and one link in the same array: `["1101624362349", "https://www.goofish.com/item?id=1086921047371"]`. The reply had 2 items, `count` 2, `billing.units` 2 and `charged_usd` 0.011111, which is two times the unit price. You can mix the two forms. The gateway bills per item, and the order of `results` matches the order you sent.

Search results and details give different data. Each result from the 00:12:29 SGT `xianyu/search` call had 18 fields. It had one `image_url` and no views or favorites, and `city` usually showed only the province. The first result said "Hubei". The `xianyu/item_detail` call for the same item added `view_count`, all photos and the city, Yichang. So the detail step is hard to skip, and so is the `urls` parameter.

The catalog lists 49 response fields for item details, and this call returned 35 of them. Fields such as `skus`, `lat` and `lng` appear only when the item has that data. The catalog `field_note` and field notes explain three points that people often misread. `price` is the seller's listed price, and the page can show a lower price after platform discounts. `sold_count` is `null` for most items, for both zero and "not shown", so `null` does not mean "no sales".

`city` in details is the city, but a few items show only the province. `original_price` is the original price that the seller entered, and it is `null` if the seller entered none. In search results, `want_count` comes from the "N wants" label on the item card. It is `null` when the card does not show it, and `null` does not mean 0. These are not errors, but handle them before you save the data.

## How do I check names and types in the free catalog first?

Read the catalog once before you write code. `GET https://api.everyinfra.com/api/v1/social/catalog` is free and needs no key. It holds the required and optional parameters, types, allowed values, prices and response fields for each capability. The full catalog that we read at 00:12 SGT on 2026-12-03 was 1,820,120 bytes, with 113 platforms and 804 capabilities. Add `?platform=xianyu` for one platform, or [`?compact=1`](https://api.everyinfra.com/api/v1/social/catalog?compact=1) for a smaller version. Xianyu has three capabilities: `search`, `item_detail` and `seller_items`.

```text
import requests

API = "https://api.everyinfra.com/api/v1/social"
caps = requests.get(f"{API}/catalog", timeout=60).json()["capabilities"]
spec = next(c for c in caps if c["platform"] == "xianyu" and c["action"] == "item_detail")

print(spec["required_params"], spec.get("optional_params", []))
for name, meta in spec.get("param_meanings", {}).items():
    print(name, meta.get("type"))
print(spec["price_usd"], spec.get("billed_by"))

# Output with the catalog read at 2026-12-03 00:12 SGT:
# ['urls'] []
# urls array
# 0.005556 urls
```

These lines answer three questions. You send `urls`, its type is `array`, and it is billed per entry (`billed_by: urls`). Run this when your program starts. Then check each request against `required_params` and `type` before you send it. You catch wrong names and missing arrays on your own machine, and they never reach the gateway.

For this local check, build the list of valid names from `required_params` plus `optional_params`. Do not use `allowed` from an error body. By the catalog, `xianyu/item_detail` has one valid parameter, `urls`. By the `allowed` list in e11, it also has `limit`.

Our 01:26 SGT test shows that the gateway accepts `limit`, but the catalog does not explain it. If your code depends on it and its behavior changes, you have no document to check. So treat any parameter outside the catalog as a mistake, and report it locally.

Xianyu keyword search is the same. The catalog lists only the required `keyword` for `xianyu/search`, but the `allowed` list in u1 is `keyword` and `limit`. Our search for test items at 00:12:29 SGT sent `"limit": 3`, returned exactly 3 rows and charged $0.008. So `limit` looks like a row-count parameter that the gateway accepts on several capabilities.

`limit` works on search, which returns rows. For details, where each item gives one result, the catalog does not explain it. The third Xianyu capability, `seller_items`, has a complete catalog entry: required `seller_id` and optional `page_token` for paging.

In Python, the way you call `requests` decides if your parameters arrive at all. The [Requests quickstart](https://requests.readthedocs.io/en/latest/user/quickstart/) explains that the `json=` argument serializes a dict to JSON and sets `Content-Type: application/json`. The `data=` argument sends form encoding. If a response body is not valid JSON, `r.json()` raises `requests.exceptions.JSONDecodeError` ([JSON response content](https://requests.readthedocs.io/en/latest/user/quickstart/#json-response-content)). A `data=` call sends the same kind of body as our 00:31:02 SGT test without a JSON header, and that test returned `validation_error`.

## How is 422 different from 400, 401 and 415?

All of these are 4xx codes, so the problem is on the request side. The difference is where the gateway stops the request. 401 means the key was not accepted. 415 means the content type is not supported. 400 means the server could not read the request.

422 means the server read it, but the content does not meet the rules. [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1) describes 400 as a client error such as malformed syntax or invalid message framing. The 422 definition says "the syntax of the request content is correct" to separate it from 400. The code first came from the 2007 WebDAV standard, [RFC 4918, section 11.2](https://www.rfc-editor.org/rfc/rfc4918.html#section-11.2), as "Unprocessable Entity". RFC 9110 moved it into core HTTP and renamed it "Unprocessable Content".

| Status | Meaning in the standard | Typical cause on the EveryInfra data API | Change the request? |
| --- | --- | --- | --- |
| 400 | Server sees a client error, such as malformed syntax ([RFC 9110 15.5.1](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1)) | Did not occur in our 16 broken requests | Yes |
| 401 | No valid credentials ([RFC 9110 15.5.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.2)) | No key, or a wrong key | Yes, fix the key |
| 415 | Content format not supported ([RFC 9110 15.5.16](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.16)) | Did not occur. Without a JSON header we returned 422 `validation_error` | Yes, add the header |
| 422 | Type known, syntax correct, cannot process ([RFC 9110 15.5.21](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.21)) | `missing_param`, `unknown_param`, `invalid_value`, `validation_error` | Yes, follow `next_steps` |
| 429 | Too many requests in a given time ([RFC 6585, section 4](https://www.rfc-editor.org/rfc/rfc6585.html#section-4)) | Call rate above the key limit, with a wait time in the body | No, wait and send again |

One result differs from the textbook. A body with one extra `}` has invalid syntax, yet our gateway returned 422 `validation_error`, not 400. [MDN's 400 page](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400) uses invalid JSON as its 400 example. APIs use both styles.

A client should branch on `error.code`, not on the status. The four codes under 422 need four different fixes, and for the caller both 400 and 422 mean "change the request and send again". Also note that a 422 counts against your per-minute call limit. A loop that resends a broken request will soon hit [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429).

![Screenshot of the English text of RFC 9110 section 15.5.21, 422 Unprocessable Content. It says the server understands the content type and the syntax is correct, but it was unable to process the contained instructions. It gives the example of well-formed XML with semantic errors. A teal box marks the definition.](https://everyinfra.com/articles/missing-param-422-error/img-rfc9110-422.webp?utm_medium=ai_doc&utm_campaign=page_md)

The standard definition of 422: known type, correct syntax, cannot process. [RFC 9110 text, screenshot taken 2026-12-03](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.21)

## How do other APIs report a missing parameter?

They do not agree on status codes or error codes. GitHub and Shopify use 422, Stripe uses 400, and FastAPI services return 422 by default. If your code calls several APIs, handle this difference on purpose. [GitHub's troubleshooting guide](https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api) says a missing required parameter or a wrong type gives 422 with "Invalid request".

A request that cannot be processed gives 422 "Validation Failed", and its `errors` property has a `code`. The code `missing_field` means a required parameter was not specified. [GitHub's search endpoints](https://docs.github.com/en/rest/search/search) list 422 as "Validation failed, or the endpoint has been spammed".

| API | Status for a missing required parameter | Error code or field | Names the parameter? | Read on |
| --- | --- | --- | --- | --- |
| GitHub REST | 422 | `errors[].code` is `missing_field` | Yes | 2026-12-03 |
| Stripe | 400 ("often due to missing a required parameter") | `parameter_missing`, error object has `param` | Yes | 2026-12-03 |
| Shopify REST Admin | 422 for semantic errors, 400 for a wrong `Content-Type` | `errors` | Depends | 2026-12-03 |
| FastAPI default | 422 | `detail[].loc`, `msg`, `type` | Yes (`loc`) | 2026-12-03 |
| OpenAQ | 422 | `errors` array | Yes | 2026-12-03 |
| EveryInfra | 422 | `missing_param` with `param`, `catalog_url`, `next_steps` | Yes, and it names the wrong key | 2026-12-03 test |

[Stripe's API error reference](https://docs.stripe.com/api/errors) showed API version 2026-11-18 when we read it. It describes 400 as "The request was unacceptable, often due to missing a required parameter". Its error object has a `param` field: "If the error is parameter-specific, the parameter related to the error." In [Stripe's error code list](https://docs.stripe.com/error-codes), `parameter_missing` means one or more required values are missing. `parameter_unknown` means the request has unexpected parameters that you must remove.

This split matches our `missing_param` and `unknown_param`, with a different HTTP status. [Shopify's response code docs](https://shopify.dev/docs/api/usage/response-codes) describe 422 as a well-formed body with semantic errors, such as incorrectly formatted input. Shopify returns 400 when `Content-Type` is not `application/json`.

Frameworks have their own defaults. [FastAPI's error handling docs](https://fastapi.tiangolo.com/tutorial/handling-errors/) say that invalid request data raises `RequestValidationError`. The default JSON has a `detail` array, and each entry has `loc` (the location), `msg` and `type`. The [request body tutorial](https://fastapi.tiangolo.com/tutorial/body/) shows how to declare a body.

Pydantic, the validation library behind FastAPI, lists its error types and fixes on its [validation errors page](https://docs.pydantic.dev/latest/errors/validation_errors/). [OpenAQ's 422 docs](https://docs.openaq.org/errors/unprocessable-content) list invalid enum values, type mismatches and invalid parameter combinations as common causes, and tell you to read the `errors` array. [Saltbox's 422 page](https://help.saltbox.io/docs/api-gateway/error-codes/api-http-422/) simply calls 422 "Missing parameters".

## Can my HTTP client lose parameters before they reach the API?

Yes. Some client patterns change the request before it leaves your program, so the gateway does not get the JSON that you think you sent. The table lists four common patterns for JSON APIs. The curl row is our test at 00:31:02 SGT. We did not send a separate request for the other three rows, so the last column for those rows is an estimate from similar tests. None of these problems is special to our API, but each one gives a different code, so the code helps you find the pattern.

| Client | Easy mistake | What the gateway gets | Result |
| --- | --- | --- | --- |
| curl | `-d` without `-H "Content-Type: application/json"` | A form-encoded body | 422 `validation_error` (tested at 00:31:02 SGT) |
| Python requests | `data=dict` instead of `json=dict` | Form encoding, `params` flattened | Not tested. Same kind of body as w3, so expect `validation_error` |
| Browser fetch | `body` set to a plain object, no `JSON.stringify` | The string `[object Object]` | Not tested. Not valid JSON, so expect `validation_error` |
| axios | `urls` in the `params` option (third argument) | `urls` in the URL query string, not in the body | Not tested. An empty `params` gave `missing_param` in e5 |

[MDN's fetch guide](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) sends JSON with `body: JSON.stringify({...})`. The body must be a string, an `ArrayBuffer` or a similar type, and a plain object turns into a string. Now the axios row. In the [axios request examples](https://axios-http.com/docs/post_example), the `params` option adds query string values to the URL, for example `params: { postId: 5 }`. It has the same name as the `params` object in our body, but a different job. If you put Xianyu items in the axios `params`, the body `params` has no `urls`.

[Postman's 422 article](https://blog.postman.com/http-422-error/) tells you to read the response body first and then compare the fields with the API description. This is easy with our API. `param` tells you which field, and `catalog_url` tells you where to compare. In Postman, set Body to raw and the format to JSON, and Postman adds the JSON header. If you pick form-data or x-www-form-urlencoded, the result is the same as curl without the header.

## How much does it cost once the call is fixed?

Requests with wrong parameters cost nothing. After the fix, `xianyu/item_detail` bills per item at the catalog price of $0.005556, which is $5.556 per 1,000 items. All 16 of our 422 bodies say "Nothing was charged.", and none of them has a `billing` block. Every successful call has `billing.charged_usd`.

Other calls ran on the same key at the same time, so a balance check cannot show the charge for one call. The proof that a 422 is free is the body text and the missing billing block. A request that passes validation is billed as usual. In e12 the extra `limit` was not rejected, and the call charged $0.005556.

| Scenario | Call pattern | Monthly volume (30 days) | Monthly cost |
| --- | --- | --- | --- |
| Check 200 Xianyu items a day | `xianyu/item_detail`, 20 items per call, 10 calls a day | 6,000 items | About $33.33 |
| Search 10 keywords a day for new items | `xianyu/search`, up to 20 rows per call | 300 calls | $2.40 |
| Both jobs together | Search, then details | n/a | About $35.73 |
| Check 1,000 items a day | `xianyu/item_detail` | 30,000 items | About $166.67 |
| One request with wrong parameters | Any capability | n/a | $0 |

The math: 200 items × 30 days is 6,000 items. At $5.555556 per 1,000 from `billing.amount.per_1k`, 6 × 5.555556 is about $33.33. Search costs $0.008 per call and returns up to 20 rows (`rows_per_unit` is 20 in the catalog). 10 keywords × 30 days is 300 calls, and 300 × $0.008 is $2.40. Our two-item test charged $0.011111, which is two times the unit price. The [pricing page](/pricing) lists catalog prices for all platforms, and the `billing` block in each response is the final record.

A call can pass validation and still cost less than you expect, when some items in the array cannot be fetched. The catalog says that billing is per item and that items we cannot fetch are refunded per item. So if 2 of 20 items are gone, you pay for 18. In our four detail calls (e7, ok1, ok2 and e12), every item was fetched, `count` matched the number of items sent, and no refund occurred. Compare `count` with the number you sent, and you can see if a batch had a refund.

`urls` does not accept the share short links from the Xianyu app, so convert them to `https://www.goofish.com/item?id=<digits>` or a numeric ID first. One call takes at most 20 items, so split larger lists. `price` is the listed price without platform discounts. Most items do not show a sold count, so `sold_count` is `null`. To get many items from one seller, use the seller item list capability. Check its parameters and price in the catalog.

![Line chart. Items checked per day: 50, 100, 200, 500 and 1,000. The 30-day xianyu/item_detail cost is about 8.33, 16.67, 33.33, 83.33 and 166.67 US dollars, at 5.555556 dollars per 1,000 items. A flat dashed line marks 0 dollars for the 16 requests with wrong parameters.](https://everyinfra.com/articles/missing-param-422-error/fig-06-monthly-cost-line.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

## How did we run the 16 broken test requests?

We sent every request in the early hours of 2026-12-03 Singapore time with one key. There were two windows, 00:12 to 00:15 and 00:30 to 00:31, a total span of about 19 minutes. We saved each request and full response. At 01:26 SGT we ran one more test for `limit` (e12), which is not in this table.

The test items came from one `xianyu/search` call for "iPhone 13" at 00:12:29 SGT, which returned 3 rows and charged $0.008. Each broken request changed one thing only, and the rest matched a correct request. That way each error code maps to one cause.

| ID | SGT | What we changed | HTTP | `code` | Charge |
| --- | --- | --- | --- | --- | --- |
| e1 | 00:12:41 | Name `item_id` | 422 | `missing_param` | $0 |
| e2 | 00:12:41 | Name `url` | 422 | `missing_param` | $0 |
| e3 | 00:12:42 | `urls` as a string | 422 | `missing_param` | $0 |
| e4 | 00:12:42 | `urls` at the top level, no `params` | 422 | `unknown_param` | $0 |
| e5 | 00:12:42 | `params: {}` | 422 | `missing_param` | $0 |
| e6 | 00:13:00 | `urls: []` | 422 | `missing_param` | $0 |
| e7 | 00:13:00 | ID as a number in the array | 200 | 1 item | $0.005556 |
| e8 | 00:13:20 | `params` as a string | 422 | `validation_error` | $0 |
| e9 | 00:13:20 | One extra `}` in the body | 422 | `validation_error` | $0 |
| e10 | 00:13:21 | Same item twice | 422 | `missing_param` | $0 |
| u1 | 00:13:21 | Search with extra `keywords_per_page` | 422 | `unknown_param` | $0 |
| u2 | 00:13:21 | Search with typo `keywrod` | 422 | `missing_param` | $0 |
| n1 | 00:13:21 | Reddit search `sort: hot` | 422 | `invalid_value` | $0 |
| n2 | 00:13:21 | Reddit search `sort: Top` (capital T) | 200 | 3 posts | $0.000792 |
| e11 | 00:13:37 | Correct `urls` plus `item_id` | 422 | `unknown_param` | $0 |
| ok1 | 00:14:47 | All fixed, one link | 200 | 1 item | $0.005556 |
| ok2 | 00:15:10 | ID and link mixed | 200 | 2 items | $0.011111 |
| w1 | 00:30:48 | `"]}}` inside the ID | 422 | `missing_param` | $0 |
| w2 | 00:30:57 | `]}}` after the link | 422 | `missing_param` | $0 |
| w3 | 00:31:02 | curl `-d` without a JSON header | 422 | `validation_error` | $0 |

Two requests that we planned as errors succeeded: e7 with a numeric ID and n2 with a capital `Top`. n2 shows that enum case is loose today. The gateway took `Top` as `top` and returned 3 Reddit posts, posted on 2026-11-05, 2026-11-13 and 2026-11-02, for $0.000792. The catalog `allowed_values` lists lowercase only, so send lowercase.

We covered e7 earlier. Both successful calls were billed at normal prices. So any test request that passes validation costs money, and you should plan automated tests with that in mind.

Total spend: the 5 successful calls in the table, including the search for test items, cost $0.031015. The 16 broken requests cost $0. With the 01:26 SGT `limit` test at $0.005556, the total is $0.036571.

![Horizontal bar chart of the 16 broken requests by error code: missing_param 9, unknown_param 3, validation_error 3, invalid_value 1. All were HTTP 422.](https://everyinfra.com/articles/missing-param-422-error/fig-03-error-code-bar.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

![Bar chart of the charge per request in US dollars. All 16 requests with HTTP 422 are 0. The successful calls are xianyu/search 0.008, xianyu/item_detail with one item 0.005556 twice, with two items 0.011111, and reddit/search 0.000792.](https://everyinfra.com/articles/missing-param-422-error/fig-05-charge-bar.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

![Timeline of 21 requests on 2026-12-03 from 00:12 to 00:31 Singapore time. 00:12:29 search for test items. From 00:12:41 to 00:13:37, 15 requests with 13 at HTTP 422 and 2 unplanned successes. 00:14:47 and 00:15:10, two fixed calls. From 00:30:48 to 00:31:02, three more 422 tests. Gray dots are 422, teal dots are successes.](https://everyinfra.com/articles/missing-param-422-error/fig-07-call-timeline.en.light.svg?utm_medium=ai_doc&utm_campaign=page_md)

![Terminal view of a curl request and its real response, laid out in terminal style. The request params use item_id. The response is HTTP 422 with error.code missing_param, and next_steps says Add the required urls (item_id is not a parameter here). Nothing was charged. A teal box marks the next_steps line.](https://everyinfra.com/articles/missing-param-422-error/img-422-response.webp?utm_medium=ai_doc&utm_campaign=page_md)

With a wrong name, next_steps names the key you sent. [Real EveryInfra API response (e1 as received), laid out in terminal style, 2026-12-03 00:12 SGT](https://api.everyinfra.com/api/v1/social/catalog?platform=xianyu)

## How do I clean a urls list on my machine before a batch?

Run a few lines of code on `urls` before you send a batch. Strip spaces, keep only numeric IDs and `https://www.goofish.com/item?id=<digits>` links, remove duplicates by item ID, and split the list into batches of 20. Each rule comes from the catalog text for `urls`. Entries are numeric IDs or Xianyu item links, and each item appears once.

A call takes 1 to 20 items, and app share short links are not accepted. The gateway runs the same checks. If you run them first, you stop the e3, e6, e10, w1 and w2 kinds of `missing_param` before any request goes out.

```text
import re

ITEM = re.compile(r"^(\d+|https://www\.goofish\.com/item\?id=(\d+))$")

def clean_urls(values):
    seen, good, bad = set(), [], []
    for v in values:
        v = str(v).strip()
        m = ITEM.match(v)
        if not m:
            bad.append(v)
            continue
        item_id = m.group(2) or m.group(1)
        if item_id in seen:
            continue
        seen.add(item_id)
        good.append(v)
    return [good[i:i + 20] for i in range(0, len(good), 20)], bad

batches, bad = clean_urls([
    "1101624362349",
    "https://www.goofish.com/item?id=1101624362349",
    "https://www.goofish.com/item?id=1086921047371]}}",
    " 1086921047371 ",
])
print(batches)  # [['1101624362349', '1086921047371']]
print(bad)      # ['https://www.goofish.com/item?id=1086921047371]}}']
```

We ran this code on our own machine, and the output is the two comment lines. The second input is the same item as the first, so the function drops it as a duplicate. The third input ends with `]}}`, so it goes into `bad` for a person to check. The fourth input is a valid ID after the spaces are removed.

Our duplicate rule is stricter than the gateway. In e10 the gateway rejected the same string twice, but we did not test an ID and a link for the same item. So the function removes duplicates by item ID, which avoids a second charge or a rejection in that case.

The batch size is 20 because that is the catalog limit. A bigger batch makes each request wait longer, but the per-item price stays the same. So batch size changes speed and retry size, not the bill. Log the `bad` list.

It usually shows problems in the source data. Examples are share short links in a spreadsheet column, or JSON brackets that an export script copied into a field. It is faster to stop these on your machine than to read one 422 per item from the gateway.

## Can an AI tool read a 422 and fix the call by itself?

Yes, if you give the model the full error body and not only "the call failed". Our 422 body is written for code and for models. `next_steps` is a full English instruction, `did_you_mean` and `allowed` hold ready-to-use values, and `example` is a request body that passes validation. When a model calls `everyinfra_*` tools over remote MCP, the tool result carries this body.

Does your own agent call the HTTP API? Then put the `error` object into the tool result as it is. The model can then fix its parameters on the next turn. Our [Sourcegraph MCP article](/blog/sourcegraph-mcp-connectors) from 2026-11-23 shows this case. The `github/repository_issues` capability needs `url`, the call sent `repo`, and it got `missing_param`. The model read `next_steps` and `example`, then sent a fixed call.

| Prompt rule | What it prevents | Field it uses |
| --- | --- | --- |
| Do not resend the same request after a 422 | A loop on one error that uses up the per-minute call limit | `retryable: false` |
| Read `error.code`, `param` and `next_steps` first | A fix to the wrong part of the request | `code`, `param`, `next_steps` |
| After `missing_param` or `unknown_param`, read the catalog | Names guessed from other APIs, such as `item_id` | `catalog_url`, `required_params` |

## What should I log so that I can trace a 422 later?

Log at least five things for each 422: `request_id`, `error.code`, `error.param`, `error.message` and the request `params` without the key. `request_id` is the only ID we need to find a call, so attach it to a support ticket. `code` and `param` let you count errors by type. `message` keeps the shape hint in brackets. `params` lets you replay the call. We saved the 21 requests in our table in this format, and these columns alone show where each one went wrong.

A count by `code` and `param` is more useful than reading logs line by line. Suppose `missing_param` on `urls` goes up in one day. A recent release probably turned an array into a string. If `unknown_param` on `item_id` goes up, some code still uses an old name. If `validation_error` goes up, check if a layer in between changed your requests to form encoding.

Three patterns point to three different places to look. Our own 16 requests give this count. `missing_param` on `urls` 8 times, and on `keyword` once. `unknown_param` 3 times, on `urls`, `item_id` and `keywords_per_page`. `invalid_value` on `sort` once, and `validation_error` 3 times with no `param`.

Do not log the key. Our error bodies never echo your key. But if your log stores the whole request with its headers, the key goes into the log. `params` and `request_id` are enough to replay and trace a call, so never log request headers. Item data in a response can include personal data such as seller names. Keep only the item ID and the fields you need in the log.

| Log field | Why you keep it |
| --- | --- |
| `request_id` | The only ID we need to find the call |
| `error.code` and `error.param` | Count errors by type and parameter |
| `error.message` | Keep the shape hint in brackets |
| `params` (no key, no headers) | Replay the call |

## When should I open a ticket instead of changing the request?

Open a ticket in one case only. The catalog lists the name or value that you sent, but the gateway still returns 422. This is the test from the second `next_steps` sentence of `invalid_value`, and it works for `missing_param` and `unknown_param` too. The check is short.

Open `catalog_url`, find the capability, and read `required_params`, `optional_params` and the `allowed_values` in `param_meanings`. Does your request match the catalog exactly, with the right types? Then open a ticket with the `request_id` from the body.

With the `request_id`, we can find the call. The reverse case is worth a ticket too. The gateway may accept a parameter that the catalog does not list, such as `limit` on `xianyu/item_detail` in e12. If your job needs its behavior, ask what it does in a ticket, and wait until the catalog documents it.

Every other 422 goes away when you change the request as the body says. For each of our 16 broken requests, `next_steps` pointed at the exact part to change. It named wrong keys, gave shapes in brackets, offered candidates in `did_you_mean`, listed accepted values in `allowed` or gave a working `example`. [MDN's 422 page](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422) says a resend without a change will fail the same way.

In a script, that means a 422 never goes into a retry queue. Log it and stop that item. [RFC 9110, section 9.2.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2) adds that a client should not retry a non-idempotent method such as POST automatically. It can do so only if it knows that a resend is safe. Our broken requests are free, but blind resends still use up your per-minute call count.

## Frequently asked questions

### What is the difference between 422 and 400?

Source of the question: the related search "Status code 422 vs 400" on the results page. Under [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.21), a 422 needs a known content type and correct syntax, and the server still cannot process the request. A 400 means the server sees a client error, such as bad syntax. APIs choose differently: Stripe returns 400 for a missing parameter, and GitHub and EveryInfra return 422. For the caller, both mean "change the request and send again", and a branch on `error.code` is more reliable than a branch on the status.

### Will the same request work if I send it again?

Source of the question: the [MDN 422 page](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422), which says "repeating the request without modification will fail with the same error". No. Our 422 bodies all have `retryable: false`. A resend gives the same error and uses up your per-minute call count.

### What does HTTP 422 mean, and does a missing parameter cost money?

Source of the question: the search suggestion "api 422 missing required parameter". 422 means the content type and syntax are correct, but the server cannot run the instructions. On the EveryInfra data API, a missing parameter gives `code: missing_param`, and it is free. All 16 of our 422 bodies end with "Nothing was charged." and have no `billing` block. Charges apply only to calls that return data, and `xianyu/item_detail` costs $0.005556 per item.

### Is "422 missing field" the same error as missing_param?

Source of the question: the search suggestion "422 unprocessable entity missing" with "missing field". Yes, the same group. Each one means that a required value was not sent. [GitHub](https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api) calls it `missing_field`, Stripe calls it `parameter_missing`, and we call it `missing_param`. Our body also gives a `param` field and names the wrong key.

### What does unknown_param mean?

Source of the question: the related codes in the same 422 group, seen in our tests e4, e11 and u1. `unknown_param` means the request has a key that the capability does not know, or a key at the wrong level. `allowed` lists all valid names at that level. For a key at the top level, the body also gives `did_you_mean: ["params.urls"]`. Remove the extra key, or move it into `params`.

### What happens if I send an enum value that is not allowed?

Source of the question: the related codes in the same 422 group, seen in our test n1. You get 422 `invalid_value`. The `message` lists every allowed value and the value you sent, for example "`sort` must be one of: controversial, newest, popular, relevance, rising, top (got 'hot')". `did_you_mean` gives the closest values, `popular` and `top`. In our test a capital `Top` was accepted, but the catalog lists lowercase only, so send lowercase.

### Are "Unprocessable Content" and "Unprocessable Entity" the same status code?

Source of the question: the related search "Unprocessable Content vs Unprocessable Entity". Yes, both are 422. The 2007 standard [RFC 4918](https://www.rfc-editor.org/rfc/rfc4918.html#section-11.2) called it Unprocessable Entity. RFC 9110 moved it into core HTTP and renamed it Unprocessable Content. The meaning did not change.

### Can `urls` be a plain string when I fetch one item?

Source of the question: our test e3 and the ticket line "passing the link does not work either". No. In e3 the link was a string, and the reply was `missing_param` with `missing required param: urls(array of item IDs or goofish.com item links)`. An array with one entry, `["https://www.goofish.com/item?id=1101624362349"]`, returned 200. A number inside the array also passed in e7, but send the ID as a string, as the catalog describes it.

### What happens if `urls` is an empty array?

Source of the question: our test e6. You get `missing_param` with only `missing required param: urls` and no brackets. `next_steps` says "Add the required `urls`.", word for word the same as for an empty `params`. If you see this sentence and you did send `urls`, check why the array is empty. Often a cell in the source spreadsheet has no value.

### Why does the same `item_id` give missing_param once and unknown_param another time?

Source of the question: our tests e1 and e11. The answer depends on the required parameter. In e1 only `item_id` was sent, so `urls` was absent. The gateway reported the missing key with `missing_param`, and `next_steps` also said that `item_id` is not a parameter here.

In e11 a correct `urls` came with an extra `item_id`. The required key was present, so the gateway returned `unknown_param` and told you to remove `item_id`. One case needs an addition, the other a removal.

### Can I send `limit` to `xianyu/item_detail`?

Source of the question: `limit` in the `allowed` list of our test e11. The gateway accepts it. At 01:26 SGT we sent `"limit": 5` with one item and got 200, one item and a charge of $0.005556. The catalog does not list this parameter or say what it does for item details, so do not depend on it. The length of the `urls` array sets how many items you get, up to 20.

### What is the parameter name and format for Xianyu item details?

Source of the question: the 2026-11-20 customer ticket, "passing the ID does not work, passing the link does not work either". The name is `urls`, and the type is an array of 1 to 20 entries. Each entry is a numeric item ID or `https://www.goofish.com/item?id=<digits>`. You can mix the two forms, and each item can appear once. The full text and an example request are on the [Xianyu item details API](/xianyu-api/item_detail) page.

## Get started

1. Get a key from the [quickstart](/docs#quickstart) and store it in the `EVERYINFRA_KEY` environment variable.
1. Open the [Xianyu item details API](/xianyu-api/item_detail) page. Confirm that the name is `urls` and the type is an array, and copy the example request.
1. Run the curl from "What does the fixed call return?" with one of your own items. Check `count` and `billing.charged_usd`.
1. If you get a 422, read `error.code` and `param` first, then follow `next_steps`. Open `catalog_url` from the body to check the parameters.
1. To find items before you fetch details, use [Xianyu keyword search](/xianyu-api/search). The same method works for other platforms, such as the [Reddit data API](/reddit-api).

Verification note: we checked this article against RFC 9110, RFC 4918, RFC 8259, RFC 6585 and the MDN pages for 422, 400, 415 and 429. We also checked the error docs of GitHub, Stripe, Shopify, FastAPI and OpenAQ, and the docs for Python json, Requests, curl and axios. We read all of them on 2026-12-03 SGT. We made the EveryInfra test calls on 2026-12-03 from 00:12 to 00:31 SGT, plus one at 01:26 SGT, and saved every response as received. AI helped write this article, and we checked each number and quote.

## References

1. [RFC 9110 HTTP Semantics, 15.5.21 422 Unprocessable Content](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.21), IETF, June 2022, read 2026-12-03
1. [RFC 9110, 15.5.1 400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1), IETF, read 2026-12-03
1. [RFC 9110, 15.5.2 401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.2), IETF, read 2026-12-03
1. [RFC 9110, 15.5.16 415 Unsupported Media Type](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.16), IETF, read 2026-12-03
1. [RFC 9110, 9.2.2 Idempotent Methods](https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2), IETF, read 2026-12-03
1. [RFC 4918 WebDAV, 11.2 422 Unprocessable Entity](https://www.rfc-editor.org/rfc/rfc4918.html#section-11.2), IETF, June 2007, read 2026-12-03
1. [RFC 8259 JSON, 2 JSON Grammar](https://www.rfc-editor.org/rfc/rfc8259.html#section-2), IETF, December 2017, read 2026-12-03
1. [RFC 6585, 4 429 Too Many Requests](https://www.rfc-editor.org/rfc/rfc6585.html#section-4), IETF, April 2012, read 2026-12-03
1. [422 Unprocessable Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422), MDN, read 2026-12-03
1. [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400), MDN, read 2026-12-03
1. [415 Unsupported Media Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/415), MDN, read 2026-12-03
1. [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429), MDN, read 2026-12-03
1. [Using the Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch), MDN, read 2026-12-03
1. [SyntaxError: JSON.parse: bad parsing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/JSON_bad_parse), MDN, read 2026-12-03
1. [json — JSON encoder and decoder](https://docs.python.org/3/library/json.html), Python documentation, read 2026-12-03
1. [json command-line interface](https://docs.python.org/3/library/json.html#json-commandline), Python documentation, read 2026-12-03
1. [Requests Quickstart](https://requests.readthedocs.io/en/latest/user/quickstart/), Requests documentation, read 2026-12-03
1. [Requests Quickstart: JSON Response Content](https://requests.readthedocs.io/en/latest/user/quickstart/#json-response-content), Requests documentation, read 2026-12-03
1. [Troubleshooting the REST API](https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api), GitHub Docs, API version 2026-03-10, read 2026-12-03
1. [REST API endpoints for search](https://docs.github.com/en/rest/search/search), GitHub Docs, read 2026-12-03
1. [Error codes](https://docs.stripe.com/error-codes), Stripe Docs, read 2026-12-03
1. [Errors](https://docs.stripe.com/api/errors), Stripe API Reference, version 2026-11-18, read 2026-12-03
1. [API response status and error codes](https://shopify.dev/docs/api/usage/response-codes), Shopify, read 2026-12-03
1. [JSON](https://everything.curl.dev/http/post/json.html), everything curl, read 2026-12-03
1. [POST Requests examples](https://axios-http.com/docs/post_example), axios documentation, read 2026-12-03
1. [Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/), FastAPI documentation, read 2026-12-03
1. [Request Body](https://fastapi.tiangolo.com/tutorial/body/), FastAPI documentation, read 2026-12-03
1. [Validation Errors](https://docs.pydantic.dev/latest/errors/validation_errors/), Pydantic documentation, read 2026-12-03
1. [422 Unprocessable Content](https://docs.openaq.org/errors/unprocessable-content), OpenAQ Docs, read 2026-12-03
1. [HTTP response code 422](https://help.saltbox.io/docs/api-gateway/error-codes/api-http-422/), Saltbox Help, read 2026-12-03
1. [422 Unprocessable Content](https://pulsetic.com/errors/422-unprocessable-content/), Pulsetic, read 2026-12-03
1. [HTTP 422 error](https://blog.postman.com/http-422-error/), Postman Blog, 2025-11-13, read 2026-12-03
1. [Social data catalog](https://api.everyinfra.com/api/v1/social/catalog), EveryInfra, read 2026-12-03 00:12 SGT
1. [Catalog: xianyu](https://api.everyinfra.com/api/v1/social/catalog?platform=xianyu), EveryInfra, read 2026-12-03
1. [Catalog: reddit](https://api.everyinfra.com/api/v1/social/catalog?platform=reddit), EveryInfra, read 2026-12-03
1. [Catalog: compact](https://api.everyinfra.com/api/v1/social/catalog?compact=1), EveryInfra, read 2026-12-03
1. [Xianyu item details API](/xianyu-api/item_detail), EveryInfra, read 2026-12-03
1. [Xianyu keyword search API](/xianyu-api/search), EveryInfra, read 2026-12-03
1. [Reddit search API](/reddit-api/search), EveryInfra, read 2026-12-03
1. [Pricing](/pricing), EveryInfra, read 2026-12-03
1. [Sourcegraph MCP connectors](/blog/sourcegraph-mcp-connectors), EveryInfra blog, 2026-11-23
1. [Xianyu data API guide](/blog/xianyu-data-api-recommendation), EveryInfra blog, 2026-11-25
