+``I`` (integer) [json_int_t]
+ Convert a JSON integer to C :type:`json_int_t`.
+
+``f`` (real) [double]
+ Convert a JSON real to C :type:`double`.
+
+``F`` (integer or real) [double]
+ Convert a JSON number (integer or real) to C :type:`double`.
+
+``o`` (any value) [json_t \*]
+ Store a JSON value with no conversion to a :type:`json_t` pointer.
+
+``O`` (any value) [json_t \*]
+ Like ``O``, but the JSON value's reference count is incremented.
+
+``[fmt]`` (array)
+ Convert each item in the JSON array according to the inner format
+ string. ``fmt`` may contain objects and arrays, i.e. recursive
+ value extraction is supporetd.
+
+``{fmt}`` (object)
+ Convert each item in the JSON object according to the inner format
+ string ``fmt``. The first, third, etc. format character represent
+ a key, and must be ``s``. The corresponding argument to unpack
+ functions is read as the object key. The second fourth, etc.
+ format character represent a value and is written to the address
+ given as the corresponding argument. **Note** that every other
+ argument is read from and every other is written to.
+
+ ``fmt`` may contain objects and arrays as values, i.e. recursive
+ value extraction is supporetd.
+
+``!``
+ This special format character is used to enable the check that
+ all object and array items are accessed, on a per-value basis. It
+ must appear inside an array or object as the last format character
+ before the closing bracket or brace. To enable the check globally,
+ use the ``JSON_STRICT`` unpacking flag.
+
+``*``
+ This special format character is the opposite of ``!``. If the
+ ``JSON_STRICT`` flag is used, ``*`` can be used to disable the
+ strict check on a per-value basis. It must appear inside an array
+ or object as the last format character before the closing bracket
+ or brace.
+
+The following functions compose the parsing and validation API:
+
+.. function:: int json_unpack(json_t *root, const char *fmt, ...)
+
+ Validate and unpack the JSON value *root* according to the format
+ string *fmt*. Returns 0 on success and -1 on failure.
+
+.. function:: int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...)
+ int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap)
+
+ Validate and unpack the JSON value *root* according to the format
+ string *fmt*. If an error occurs and *error* is not *NULL*, write
+ error information to *error*. *flags* can be used to control the
+ behaviour of the unpacker, see below for the flags. Returns 0 on
+ success and -1 on failure.
+
+.. note::
+
+ The first argument of all unpack functions is ``json_t *root``
+ instead of ``const json_t *root``, because the use of ``O`` format
+ character causes the reference count of ``root``, or some value
+ reachable from ``root``, to be increased. Furthermore, the ``o``
+ format character may be used to extract a value as-is, which allows
+ modifying the structure or contents of a value reachable from
+ ``root``.
+
+ If the ``O`` and ``o`` format character are not used, it's
+ perfectly safe to cast a ``const json_t *`` variable to plain
+ ``json_t *`` when used with these functions.
+
+The following unpacking flags are available:
+
+``JSON_STRICT``
+ Enable the extra validation step checking that all object and
+ array items are unpacked. This is equivalent to appending the
+ format character ``!`` to the end of every array and object in the
+ format string.
+
+``JSON_VALIDATE_ONLY``
+ Don't extract any data, just validate the JSON value against the
+ given format string. Note that object keys must still be specified
+ after the format string.
+
+Examples::
+
+ /* root is the JSON integer 42 */
+ int myint;
+ json_unpack(root, "i", &myint);
+ assert(myint == 42);
+
+ /* root is the JSON object {"foo": "bar", "quux": true} */
+ const char *str;
+ int boolean;
+ json_unpack(root, "{s:s, s:b}", "foo", &str, "quux", &boolean);
+ assert(strcmp(str, "bar") == 0 && boolean == 1);
+
+ /* root is the JSON array [[1, 2], {"baz": null} */
+ json_error_t error;
+ json_unpack_ex(root, &error, JSON_VALIDATE_ONLY, "[[i,i], {s:n}]", "baz");
+ /* returns 0 for validation success, nothing is extracted */
+
+ /* root is the JSON array [1, 2, 3, 4, 5] */
+ int myint1, myint2;
+ json_unpack(root, "[ii!]", &myint1, &myint2);
+ /* returns -1 for failed validation */