Sourcify — Get verified contract
By default returns minimal information about the contract: `match`, `creationMatch`, `runtimeMatch`, `chainId`, `address`, and `verifiedAt`. To get other details one can either list the fields requested in the `fields` query param or ask all fields but omit several with `omit`. To get everything just pass `fields=all`. **Request only the fields that you need.** `fields=all` returns every field, including all source files and the full standard JSON input and output. It is the most expensive request on this endpoint. Do not use `fields=all` or `stdJsonInput` in loops. To collect data for many contracts, use the [Parquet export](https://docs.sourcify.dev/docs/repository/download-dataset/) or the [BigQuery dataset](https://docs.sourcify.dev/docs/bigquery/) instead. **Available fields:** - `matchId` – unique match ID - `creationMatch` – creation bytecode match status (`match`, `exact_match`, or `null`) - `runtimeMatch` – runtime bytecode match status (`match`, `exact_match`, or `null`) - `verifiedAt` – ISO 8601 timestamp of when the current match was verified. If a later verification upgrades the match (for example from `match` to `exact_match`), this timestamp changes to the time of that verification. - `abi` – contract ABI - `metadata` – Solidity compiler metadata object - `sources` – map of source file paths to their content - `sourceIds` – AST source IDs from the standard JSON compiler output - `userdoc` – user-facing NatSpec documentation - `devdoc` – developer NatSpec documentation - `storageLayout` – contract storage layout - `transientStorageLayout` – transient storage layout (Solidity >= 0.8.24) - `additionalInput` – extra top-level compiler input fields (e.g. Vyper `storage_layout_overrides`) - `stdJsonInput` – full standard JSON compiler input - `stdJsonOutput` – full standard JSON compiler output Nested objects support dot-notation sub-selection (e.g. `creationBytecode.onchainBytecode`): - `creationBytecode` — sub-fields: `onchainBytecode`, `recompiledBytecode`, `sourceMap`, `linkReferences`, `cborAuxdata`, `transformations`, `transformationValues` - `runtimeBytecode` — sub-fields: `onchainBytecode`, `recompiledBytecode`, `sourceMap`, `linkReferences`, `cborAuxdata`, `immutableReferences`, `transformations`, `transformationValues` - `deployment` — sub-fields: `transactionHash`, `blockNumber`, `transactionIndex`, `deployer` - `compilation` — sub-fields: `language`, `compiler`, `compilerVersion`, `compilerSettings`, `name`, `fullyQualifiedName` - `signatures` — sub-fields: `function`, `event`, `error` - `proxyResolution` – proxy detection result (no sub-fields) Documentation prepared only; runtime not verified.
- Selected price
- $0 / callPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- —Loading...
- Success rate · 30d
- —Loading...
Sourcify — Get verified contract
Prepare your request, then continue with your agent.
Selected price
$0 / call
- Provider
- Pricing
On this page
Playground
Run sends a real API request. Charges follow the published API contract.
Response structure
addressstringchainIdstringcreationMatchstringmatchstringmatchIdstringruntimeMatchstringverifiedAtstring
// Inferred from response examples. Fields are optional and other fields may be returned.
export type ApiResponse = {
address?: string;
chainId?: string;
creationMatch?: string;
match?: string;
matchId?: string;
runtimeMatch?: string;
verifiedAt?: string;
};Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
sourcifyCurrent Sourcify — Get verified contract · GET · View API reference | $0 / call | — | —successP50— |
- Unit price
- $0
Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 2. Price update time: not supplied.
Total $0
API
- Method
- GET
- Endpoint
https://api.openany.si/v1/agent-apis/sourcify/server/v2/contract/{chainId}/{address}- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
'https://api.openany.si/v1/agent-apis/sourcify/server/v2/contract/1/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' \
-X GET \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json'Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
chainId | URL path parameterspath | string | Yes | The chainId number of the EVM chain minLength: 1 · maxLength: 20 |
address | URL path parameterspath | string | Yes | Contract's 20 byte address in hex string with the 0x prefix. Case insensitive. minLength: 42 · maxLength: 42 |
fields | URL query parametersquery | string | No | Comma-separated list of fields to include in the response. Can also be `all` to return every available field. See the endpoint description for the full list of available fields. `all` includes all source files and the full standard JSON input and output, so it is expensive. Do not use `all` in loops. Request only the fields that you need. |
omit | URL query parametersquery | string | No | Comma seperated fields to NOT include in the response. All fields except matching ones will be returned. Can't be used simultanously with `fields`. A short `omit` list returns almost every field, so it costs almost as much as `fields=all`. Do not use `omit` in loops. Use `fields` to request only what you need. |
Required markers inside a nested object or variant apply when that object or variant is used.
Sample response
Sample response · Documented HTTP 200 Published documentation example. Verify the actual response after an approved call.
{
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": "1",
"creationMatch": "match",
"match": "match",
"matchId": "1605500",
"runtimeMatch": "match",
"verifiedAt": "2024-08-08T13:28:37Z"
}Agent integration
Copy the resource contract without sharing an API key.
View API Markdown
# Sourcify — Get verified contract
By default returns minimal information about the contract: `match`, `creationMatch`, `runtimeMatch`, `chainId`, `address`, and `verifiedAt`.
To get other details one can either list the fields requested in the `fields` query param or ask all fields but omit several with `omit`. To get everything just pass `fields=all`.
**Request only the fields that you need.** `fields=all` returns every field, including all source files and the full standard JSON input and output. It is the most expensive request on this endpoint. Do not use `fields=all` or `stdJsonInput` in loops. To collect data for many contracts, use the [Parquet export](https://docs.sourcify.dev/docs/repository/download-dataset/) or the [BigQuery dataset](https://docs.sourcify.dev/docs/bigquery/) instead.
**Available fields:**
- `matchId` – unique match ID
- `creationMatch` – creation bytecode match status (`match`, `exact_match`, or `null`)
- `runtimeMatch` – runtime bytecode match status (`match`, `exact_match`, or `null`)
- `verifiedAt` – ISO 8601 timestamp of when the current match was verified. If a later verification upgrades the match (for example from `match` to `exact_match`), this timestamp changes to the time of that verification.
- `abi` – contract ABI
- `metadata` – Solidity compiler metadata object
- `sources` – map of source file paths to their content
- `sourceIds` – AST source IDs from the standard JSON compiler output
- `userdoc` – user-facing NatSpec documentation
- `devdoc` – developer NatSpec documentation
- `storageLayout` – contract storage layout
- `transientStorageLayout` – transient storage layout (Solidity >= 0.8.24)
- `additionalInput` – extra top-level compiler input fields (e.g. Vyper `storage_layout_overrides`)
- `stdJsonInput` – full standard JSON compiler input
- `stdJsonOutput` – full standard JSON compiler output
Nested objects support dot-notation sub-selection (e.g. `creationBytecode.onchainBytecode`):
- `creationBytecode` — sub-fields: `onchainBytecode`, `recompiledBytecode`, `sourceMap`, `linkReferences`, `cborAuxdata`, `transformations`, `transformationValues`
- `runtimeBytecode` — sub-fields: `onchainBytecode`, `recompiledBytecode`, `sourceMap`, `linkReferences`, `cborAuxdata`, `immutableReferences`, `transformations`, `transformationValues`
- `deployment` — sub-fields: `transactionHash`, `blockNumber`, `transactionIndex`, `deployer`
- `compilation` — sub-fields: `language`, `compiler`, `compilerVersion`, `compilerSettings`, `name`, `fullyQualifiedName`
- `signatures` — sub-fields: `function`, `event`, `error`
- `proxyResolution` – proxy detection result (no sub-fields) Documentation prepared only; runtime not verified.
## Available implementations
sourcify · Sourcify — Get verified contract: https://openany.si/markets/apis/capabilities/sourcify-get-verified-contract?offering=b1f1a1c2-4760-4c7a-8c9d-38e56490243a · $0 / call
## Selected API contract
Documentation: https://openany.si/apis/b1f1a1c2-4760-4c7a-8c9d-38e56490243a
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/sourcify/server/v2/contract/{chainId}/{address}
Price: $0 / call
Provider: sourcify
Contract revision: 2
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.
Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.
## Prepared request
```bash
curl \
'https://api.openany.si/v1/agent-apis/sourcify/server/v2/contract/1/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' \
-X GET \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json'
```
## API contract
```json
{
"resource_type": "api",
"name": "Sourcify — Get verified contract",
"endpoint": "https://api.openany.si/v1/agent-apis/sourcify/server/v2/contract/{chainId}/{address}",
"method": "GET",
"content_type": "none",
"execution_mode": "sync",
"authentication": {
"type": "bearer",
"environment_variable": "OPENANY_API_KEY"
},
"inputs": [
{
"description": "The chainId number of the EVM chain",
"location": "path",
"max_length": 20,
"min_length": 1,
"name": "chainId",
"nullable": false,
"required": true,
"type": "string"
},
{
"description": "Contract's 20 byte address in hex string with the 0x prefix. Case insensitive.",
"location": "path",
"max_length": 42,
"min_length": 42,
"name": "address",
"nullable": false,
"required": true,
"type": "string"
},
{
"description": "Comma-separated list of fields to include in the response. Can also be `all` to return every available field. See the endpoint description for the full list of available fields. `all` includes all source files and the full standard JSON input and output, so it is expensive. Do not use `all` in loops. Request only the fields that you need.",
"location": "query",
"name": "fields",
"nullable": false,
"required": false,
"type": "string"
},
{
"description": "Comma seperated fields to NOT include in the response. All fields except matching ones will be returned. Can't be used simultanously with `fields`. A short `omit` list returns almost every field, so it costs almost as much as `fields=all`. Do not use `omit` in loops. Use `fields` to request only what you need.",
"location": "query",
"name": "omit",
"nullable": false,
"required": false,
"type": "string"
}
],
"billing": {
"currency": "USD",
"mode": "fixed",
"priceMicroUsd": "0",
"rounding": null,
"unit": "call",
"unitQuantity": null
},
"examples": [
{
"http_status": 200,
"name": "Documentation example",
"request": {
"body": null,
"headers": {},
"path": {
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": "1"
},
"query": {}
},
"response_body": {
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"chainId": "1",
"creationMatch": "match",
"match": "match",
"matchId": "1605500",
"runtimeMatch": "match",
"verifiedAt": "2024-08-08T13:28:37Z"
}
}
]
}
```Error handling
| Status | Next step |
|---|---|
400 | Check the offering and request fields. |
401 / 403 | Verify your credentials and access permissions. |
402 | Inspect the selected access mode and returned payment requirements. |
429 | Respect the returned rate limit and retry guidance. |
5xx | Inspect the error and usage record before retrying a paid operation. |
Examples
Documentation example
Published documentation example. Verify the actual response after an approved call.
Prepare your environment
Use a terminal with cURL installed.
Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.
Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.
Terminal · macOS / Linuxprintf 'OpenAny API key: ' read -r -s OPENANY_API_KEY export OPENANY_API_KEY printf '\n'Run the request
Paste the complete command below into your terminal.
Values to replace before running 4
Review these request fields before running. Keep the published provider and request method unchanged.
chainId- The chainId number of the EVM chain
address- Contract's 20 byte address in hex string with the 0x prefix. Case insensitive.
fields- Comma-separated list of fields to include in the response. Can also be `all` to return every available field. See the endpoint description for the full list of available fields. `all` includes all source files and the full standard JSON input and output, so it is expensive. Do not use `all` in loops. Request only the fields that you need.
omit- Comma seperated fields to NOT include in the response. All fields except matching ones will be returned. Can't be used simultanously with `fields`. A short `omit` list returns almost every field, so it costs almost as much as `fields=all`. Do not use `omit` in loops. Use `fields` to request only what you need.
Terminal · cURLcurl \ 'https://api.openany.si/v1/agent-apis/sourcify/server/v2/contract/1/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' \ -X GET \ -H "Authorization: Bearer $OPENANY_API_KEY" \ -H 'Content-Type: application/json'Check the response
Sample response · Documented HTTP 200
Sample response{ "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "chainId": "1", "creationMatch": "match", "match": "match", "matchId": "1605500", "runtimeMatch": "match", "verifiedAt": "2024-08-08T13:28:37Z" }