---
title: "Get Script by Hash"
method: GET
path: "/scripts/{script-hash}"
tags: ["Scripts"]
---

# Get Script by Hash

`GET /scripts/{script-hash}`

Retrieve the raw script (i.e. full resolved script) associated to a given script hash digest.

> <sup><strong>NOTE</strong></sup> <br/>
>
> Raw scripts aren't exact pre-image of their hash digest. Before hashing, scripts are prefixed with a
> certain discriminator byte depending on the language. For instance, any native script is prefixed with
> `00` before hashing.
>
> Here's a table summarizing all discriminators:
>
> | Language    | Discriminator Byte |
> | ---         | ---                |
> | `native`    | `00`               |
> | `plutus:v1` | `01`               |
> | `plutus:v2` | `02`               |

## Path parameters

- `script_hash` string, required

## Response `200`

OK

## Other responses

- `304` — Not Modified Returned when a `If-None-Match` request header matches the current `ETag` for the response. This is meant to provide efficient caching and polling. The `ETag` corresponds to the most recent block header hash processed by Kupo.
- `400` — Bad Request

---

[API](https://skmtc.net/txpipe/apis/kupo.md) · [All operations](https://skmtc.net/txpipe/apis/kupo/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/txpipe/kupo/revisions/33786c4eb0ff/schema)
