Базовый URL

https://paste.lastgame.space

1. Создать новую запись

POST /api/create

Создаёт новую запись с текстом и возвращает ссылку на неё.

Запрос

Поддерживает два формата:

JSON:

{
  "text": "Ваш текст здесь"
}

Form-data:

text=Ваш текст здесь

Ответ (успех)

{
  "success": true,
  "id": "a1b2c3d4",
  "url": "https://paste.lastgame.space/a1b2c3d4",
  "created_at": "2026-01-12T22:00:00",
  "expires_at": "2026-02-11T22:00:00"
}

Ответ (ошибка)

{
  "success": false,
  "error": "Текст не может быть пустым"
}

2. Получить запись

GET /api/get/<paste_id>

Получает текст записи по её ID.

Ответ (успех)

{
  "success": true,
  "id": "a1b2c3d4",
  "text": "Ваш текст здесь",
  "created_at": "2026-01-12T22:00:00",
  "expires_at": "2026-02-11T22:00:00",
  "days_left": 25
}

Ответ (ошибка)

{
  "success": false,
  "error": "Запись не найдена или срок её хранения истёк"
}

Примеры использования

Python

import requests

# Создать запись
response = requests.post('https://paste.lastgame.space/api/create', 
                        json={'text': 'Ошибка: Connection timeout'})
data = response.json()
print(f"Ссылка: {data['url']}")

# Получить запись
response = requests.get(f"https://paste.lastgame.space/api/get/{data['id']}")
print(response.json()['text'])

JavaScript/Node.js

// Создать запись
fetch('https://paste.lastgame.space/api/create', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({ text: 'Ошибка: Connection timeout' })
})
.then(response => response.json())
.then(data => console.log('Ссылка:', data.url));

// Получить запись
fetch('https://paste.lastgame.space/api/get/a1b2c3d4')
.then(response => response.json())
.then(data => console.log('Текст:', data.text));

Java

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

// Создать запись
HttpClient client = HttpClient.newHttpClient();
String json = "{\"text\":\"Ошибка: Connection timeout\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://paste.lastgame.space/api/create"))
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();
HttpResponse<String> response = client.send(request, 
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

cURL

# Создать запись
curl -X POST https://paste.lastgame.space/api/create \
  -H "Content-Type: application/json" \
  -d '{"text":"Ошибка: Connection timeout"}'

# Получить запись
curl https://paste.lastgame.space/api/get/a1b2c3d4

PHP

<?php
// Создать запись
$data = array('text' => 'Ошибка: Connection timeout');
$options = array(
    'http' => array(
        'header'  => "Content-type: application/json\r\n",
        'method'  => 'POST',
        'content' => json_encode($data)
    )
);
$context = stream_context_create($options);
$result = file_get_contents('https://paste.lastgame.space/api/create', false, $context);
echo $result;
?>

Go

package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

// Создать запись
type Request struct {
    Text string `json:"text"`
}

data := Request{Text: "Ошибка: Connection timeout"}
jsonData, _ := json.Marshal(data)
resp, _ := http.Post("https://paste.lastgame.space/api/create", 
    "application/json", bytes.NewBuffer(jsonData))
defer resp.Body.Close()

Примечания

  • Записи автоматически удаляются через 30 дней
  • API поддерживает CORS, можно использовать с любого домена
  • Максимальный размер текста ограничен только настройками сервера
  • Все даты в формате ISO 8601