Skip to content
POST AI agent ready /v1/paste/get

Paste Retrieval API - Free Text Snippet Fetch

Submit a paste ID and receive the stored content along with its language tag and creation timestamp. Returns a 404 if the paste has expired or does not exist. Used in combination with the /v1/paste/create endpoint.

Parameters

stringrequired

The paste ID returned by the create endpoint.

Code examples

curl -X POST https://api.botoi.com/v1/paste/get \
  -H "Content-Type: application/json" \
  -d '{"id":"f9e8d7c6"}'

When to use this API

Display shared code snippets with syntax highlighting in your app

Fetch the paste content and language tag, then render it with a client-side highlighter like Prism or Shiki. The language tag tells your highlighter which grammar to apply.

Pull config data into a deployment script

Store deployment config as a paste, then fetch it by ID in your script. This avoids hardcoding config in your repository while keeping it available for the duration of the deployment window.

Build a "view shared snippet" page for your developer tool

When a user shares a paste link, fetch the content via this endpoint and render it in a formatted code viewer. Show the language, creation time, and a copy button.

Frequently asked questions

What happens if the paste has expired?
The API returns a 404 error with the code NOT_FOUND and a message indicating the paste was not found or has expired.
Can anyone retrieve a paste if they have the ID?
Yes. There is no access control on individual pastes. Anyone with the 8-character ID can retrieve the content. Do not store sensitive data in pastes without encrypting it first.
Does retrieving a paste extend its TTL?
No. The TTL is set at creation time and does not change. Reading the paste has no effect on its expiration.
Is the paste ID passed in the URL or the request body?
The paste ID is passed in the JSON request body as the "id" field. The endpoint path is always /v1/paste/get.
Can I retrieve multiple pastes in one request?
No. Each request retrieves a single paste. To fetch multiple pastes, make parallel requests with different IDs.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.