# JsonApi (deprecated)

> Data retrieval from Web2 JSON APIs with JQ transformations.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/fdc/attestation-types/json-api

danger

Since May 2025 this spec is considered deprecated. The `JsonApi` attestation type has been update to a new version, `Web2Json`. You can find the updated version of this spec [here](/fdc/attestation-types/web2-json).

Data retrieval from **Web2 JSON APIs** with JQ transformations. This attestation type allows smart contracts to access and process external JSON data in a verifiable way.

Testnet Only

JsonApi attestation type is currently only available on Flare Testnet Coston2 and Songbird Testnet Coston.

## Supported sources[​](#supported-sources "Direct link to Supported sources")

Network Type

Sources

**Web2**

`WEB2` (Web 2.0 JSON APIs)

**Testnet**

`testWEB2`

## Request[​](#request "Direct link to Request")

Field

Solidity Type

Description

`url`

`string`

URL of the JSON API endpoint to query.

`postprocessJq`

`string`

JQ filter expression to transform the retrieved JSON data.

`abi_signature`

`string`

ABI signature defining the struct format for encoding the transformed JSON data.

## Response[​](#response "Direct link to Response")

Field

Solidity Type

Description

`abi_encoded_data`

`bytes`

ABI-encoded data result after JQ transformation.

## Verification Process[​](#verification-process "Direct link to Verification Process")

### 1\. API Request[​](#1-api-request "Direct link to 1. API Request")

The attestation service performs a GET request to the specified `url`.

-   If the request fails or returns non-JSON data, the attestation request is rejected.
-   The service validates that the response is valid JSON data.

### 2\. JQ Transformation[​](#2-jq-transformation "Direct link to 2. JQ Transformation")

The specified `postprocessJq` filter is applied to the retrieved JSON:

-   The JQ filter must be a valid JQ expression.
-   The filter's output must match the structure defined in `abi_signature`.
-   If the JQ transformation fails, the attestation request is rejected.

### 3\. ABI Encoding[​](#3-abi-encoding "Direct link to 3. ABI Encoding")

The transformed data is ABI-encoded according to the provided `abi_signature`:

-   The encoding must match the Solidity ABI specification.
-   The encoded bytes are returned in `abi_encoded_data`.
