> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomaestro.org/llms.txt
> Use this file to discover all available pages before exploring further.

> Get Cardano script details by script hash including Plutus script information and execution parameters.

# Script by script hash



## OpenAPI

````yaml cardano/blockchain-indexer-api/openapi.json get /scripts/{script_hash}
openapi: 3.0.3
info:
  title: Cardano - Blockchain Indexer API
  description: Core indexer endpoints dedicated to Cardano.
  contact:
    name: Maestro Blockchain Inc.
    url: https://gomaestro.org/
    email: info@gomaestro.org
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.txt
  version: v1.8.0
servers:
  - url: https://mainnet.gomaestro-api.org/v1
    description: Cardano Mainnet
  - url: https://preprod.gomaestro-api.org/v1
    description: Cardano Preprod
  - url: https://preview.gomaestro-api.org/v1
    description: Cardano Preview
security:
  - api-key: []
tags:
  - name: Maestro
paths:
  /scripts/{script_hash}:
    get:
      tags:
        - Scripts
      summary: Script by script hash
      description: >-
        Returns the script corresponding to the specified script hash, if the
        script has been seen on-chain
      operationId: script_by_hash
      parameters:
        - name: script_hash
          in: path
          description: Hex encoded script hash
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Script corresponding to the provided script hash
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimestampedScriptFirstSeen'
              examples:
                Native:
                  summary: An example response for a Native script
                  value:
                    data:
                      hash: f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a
                      type: native
                      bytes: >-
                        8200581c4da965a049dfd15ed1ee19fba6e2974a0b79fc416dd1796a1f97f5e1
                      json:
                        keyHash: >-
                          4da965a049dfd15ed1ee19fba6e2974a0b79fc416dd1796a1f97f5e1
                        type: sig
                      first_seen:
                        tx_hash: >-
                          257916e7ae112cf16f27218e41bfa37c018bab922354201b3b38c9a24c35ab33
                        slot: 55718892
                        timestamp: '2022-03-14 19:13:03'
                    last_updated:
                      timestamp: '2023-10-18 07:30:52'
                      block_hash: >-
                        0e1e924710135acfe200ab13d290bd282a67584fd54456f0dcac0aeaa38bb2c2
                      block_slot: 106047961
                Plutus:
                  summary: An example response for a Plutus script
                  value:
                    data:
                      hash: a65ca58a4e9c755fa830173d2a5caed458ac0c73f97db7faae2e7e3b
                      type: plutusv1
                      bytes: >-
                        59014f59014c0100003232323232323232222...8c0088cc00800800555cf2ba15573e6e1d200201
                      json: null
                      first_seen:
                        tx_hash: >-
                          27836bbea6fba67a9209de16c81d426e92ac218e5007fbf86d3a6786ca1db316
                        slot: 106047961
                        timestamp: '2023-10-18 07:30:52'
                    last_updated:
                      timestamp: '2023-10-18 07:30:52'
                      block_hash: >-
                        0e1e924710135acfe200ab13d290bd282a67584fd54456f0dcac0aeaa38bb2c2
                      block_slot: 106047961
        '400':
          description: Malformed query parameters
        '404':
          description: No results found
        '500':
          description: Internal server error
components:
  schemas:
    TimestampedScriptFirstSeen:
      type: object
      description: >-
        Timestamped response. Returns the endpoint response data along with the
        chain-tip of the indexer, which details at which point in the chain's
        history the data was correct as-of.
      required:
        - data
        - last_updated
      properties:
        data:
          $ref: '#/components/schemas/ScriptFirstSeen'
        last_updated:
          $ref: '#/components/schemas/LastUpdated'
    ScriptFirstSeen:
      type: object
      description: Details of a Native or Plutus script
      required:
        - hash
        - type
        - bytes
        - first_seen
      properties:
        bytes:
          type: string
          description: Script bytes
        first_seen:
          $ref: '#/components/schemas/TimestampedTransaction'
        hash:
          type: string
          description: Script hash
        json:
          type: object
          description: >-
            JSON representation of script (`null` if script not of `native`
            type)
          nullable: true
        type:
          $ref: '#/components/schemas/ScriptType'
    LastUpdated:
      type: object
      description: >-
        Details of the most recent block processed by the indexer (aka chain
        tip); that is, the data returned is correct as of this block in time.
      required:
        - timestamp
        - block_hash
        - block_slot
      properties:
        block_hash:
          type: string
          description: >-
            Hex-encoded hash of the most recently processed block (aka chain
            tip)
        block_slot:
          type: integer
          format: int64
          description: Absolute slot of the most recently processed block (aka chain tip)
          minimum: 0
        timestamp:
          type: string
          description: UTC timestamp of when the most recently processed block was minted
    TimestampedTransaction:
      type: object
      description: Transaction hash with details of when that transaction appeared on-chain
      required:
        - tx_hash
        - slot
        - timestamp
      properties:
        slot:
          type: integer
          format: int64
          description: Absolute slot of the block which includes the transaction
          minimum: 0
        timestamp:
          type: string
          description: UTC timestamp of the block which includes the transaction
        tx_hash:
          type: string
          description: Transaction hash
    ScriptType:
      type: string
      description: Script type and version
      enum:
        - native
        - plutusv1
        - plutusv2
        - plutusv3
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: api-key
      description: Project API Key

````