NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Glossary

JSON: the data format of web APIs

JSON, JavaScript Object Notation, is a plain text format for structured data that almost every web API uses for request and response bodies.

The building blocks

JSON has six kinds of value: objects ({ }, unordered name and value pairs), arrays ([ ], ordered lists), strings in double quotes, numbers, the literals true and false, and null. Objects and arrays nest to any depth. That small set is enough to describe almost any API payload, which is why the format won. It is defined in RFC 8259 and ECMA-404, and the text must be UTF-8 when exchanged between systems.

Syntax rules that trip people up

  • Names and strings use double quotes only. {'a': 1} is not JSON.
  • No trailing commas: [1, 2, ] is invalid.
  • No comments of any kind.
  • No NaN, Infinity or undefined.
  • Backslashes and control characters inside strings must be escaped, as in "C:\\temp" or "line\nbreak".
  • Numbers have no leading zeros or plus sign, and very large integers may lose precision in JavaScript.

Building JSON by gluing strings together is the main source of these errors. Use your language's serializer (json.dumps, JSON.stringify, encoding/json) and they disappear.

What createTask expects

A GateSolver request is a JSON object with your key and a task object. Field names are case sensitive and must match the documentation exactly.

{"clientKey": "YOUR_API_KEY", "task": {"type": "MtCaptchaTaskProxyLess",
  "websiteURL": "https://accounts.example.org/signup",
  "websiteKey": "MTPublic-xxxxxxxx"}}

Send it with the Content-Type: application/json header. If a required field is missing, the API answers with ERROR_INVALID_TASK_DATA, and the description names the field, so read it before guessing. Error responses are free. The answer for this MTCaptcha example arrives in solution.token, typically under 5 seconds.

Reading responses safely

Parse first, then check fields defensively. A reply may lack a field you expect, or carry extra fields you do not; your code should cope with both. In Python, reply.get("solution", {}).get("token") avoids a crash when a task failed and no solution exists. Check errorId before anything else.

JSON on the sites you scrape

JSON shows up all over websites: responses from internal APIs (see hidden API scraping), JSON-LD blocks describing products and articles, and state objects that frameworks embed in a script tag for hydration. Reading these is usually easier and more stable than parsing HTML. When a JSON endpoint suddenly returns HTML, parsing fails with an error like "Unexpected token <", which very often means you received a challenge page instead of data; check the content type and the first characters before parsing.

Pretty printing and debugging

When a request fails, print the exact JSON you sent, formatted with indentation, and compare it with the documented example. Tools such as jq on the command line make it quick to inspect large responses and pull out one field. Small typos in field names, or a number sent as a string, are much easier to spot this way than in a single long line.

Related formats

JSON Lines (one JSON object per line) is handy for logs and large scrape outputs, since each line can be appended and read independently. JSON Schema describes the expected shape of a document and can validate responses automatically, which helps catch a silent change in a site's data. For converting results, see convert JSON to CSV.

Common questions

Can JSON contain comments?

No. The format has no comment syntax, so parsers reject them.

Why does my JSON parse fail with Unexpected token less than?

The response was HTML, often an error or challenge page, rather than the JSON you expected.

Are JSON field names case sensitive?

Yes. websiteURL and websiteUrl are different fields, so match the documentation exactly.

What content type should a JSON request use?

application/json, which the GateSolver API expects on every call.

What is JSON Lines?

A format with one JSON object per line, convenient for logs and large datasets that grow by appending.

Keep reading