qan_getCode

get

https://rpc-testnet.qanplatform.com/getCode/{Address}/

API details

Returns the compiled bytecode of a smart contract.

Parameters for "qan_getCode"

Path parameters
AddressstringRequired

The address of the smart contract from which the bytecode will be obtained

Examples:0xa1e4380a3b1f749673e270229993ee55f35663b40xA1E4380A3B1f749673E270229993eE55F35663b40XA1E4380A3B1F749673E270229993EE55F35663B4A1E4380A3B1f749673E270229993eE55F35663b4

Query parameters
BlockNumberstring

The block number in hexadecimal or decimal format or the string latest, earliest, pending

Default:latest

Examples:latest

HTTP response status codes for "qan_getCode"

Status Code Description
200 OK
400 Bad Request
404 Not Found
422 Unprocessable Entity
500 Internal Server Error

Code samples for "qan_getCode"

Request examples

get

https://rpc-testnet.qanplatform.com/getCode/{Address}/

cURLJavaScriptGoPythonJava
curl --request GET \
  --url https://rpc-testnet.qanplatform.com/getCode/{Address}/ \
  --header 'Accept: application/json, application/problem+json'
const options = {method: 'GET', headers: {Accept: 'application/json, application/problem+json'}};

fetch('https://rpc-testnet.qanplatform.com/getCode/{Address}/', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "https://rpc-testnet.qanplatform.com/getCode/{Address}/"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Accept", "application/json, application/problem+json")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)

  fmt.Println(string(body))

}
import requests

url = "https://rpc-testnet.qanplatform.com/getCode/{Address}/"

headers = {"Accept": "application/json, application/problem+json"}

response = requests.get(url, headers=headers)

print(response.text)
HttpResponse<String> response = Unirest.get("https://rpc-testnet.qanplatform.com/getCode/{Address}/")
  .header("Accept", "application/json, application/problem+json")
  .asString();

Responses

200400404422500

Description: OK

Content type: application/json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/Output_getCode.json",
  "Bytecode": "string"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/Output_getCode.json

BytecodestringRequired

The bytecode from a given address

Description: Bad Request

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Description: Not Found

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Description: Unprocessable Entity

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Description: Internal Server Error

Content type: application/problem+json

Example

{
  "$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Body

$schemastring<uri>

A URL to the JSON Schema for this object.

Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json

detailstring

A human-readable explanation specific to this occurrence of the problem.

Example:Property foo is required but is missing.

errorsarray[object]

Optional list of individual error details

locationstring

Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'

messagestring

Error message text

valueany

The value at the given location

instancestring<uri>

A URI reference that identifies the specific occurrence of the problem.

Example:https://example.com/error-log/abc123

statusinteger<int64>

HTTP status code

Example:400

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

Example:Bad Request

typestring<uri>

A URI reference to human-readable documentation for the error.

Default:about:blank

Example:https://example.com/errors/example

Previous

qan_getBlockTransactionCountByNumber

Next

qan_getFilterChanges