ScreenshotAPI

Credits API

Endpoints for checking credit balance, listing packs, purchasing credits, and viewing transaction history.

Get Credit Balance

GET /api/v1/credits

Returns the current credit balance for the authenticated user. Requires session authentication.

Response

{
  "balance": 847
}

Example

curl "https://screenshotapi.to/api/v1/credits" \
  --cookie "session=your_session_cookie"
const response = await fetch('https://screenshotapi.to/api/v1/credits', {
  credentials: 'include'
})

const { balance } = await response.json()
console.log(`Credits remaining: ${balance}`)
import requests

response = requests.get(
    "https://screenshotapi.to/api/v1/credits",
    cookies={"session": "your_session_cookie"}
)

print(f"Credits remaining: {response.json()['balance']}")
package main

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

func main() {
	req, _ := http.NewRequest("GET", "https://screenshotapi.to/api/v1/credits", nil)
	req.AddCookie(&http.Cookie{Name: "session", Value: "your_session_cookie"})
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var result struct {
		Balance int `json:"balance"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Printf("Credits remaining: %d\n", result.Balance)
}
require "net/http"
require "json"

uri = URI("https://screenshotapi.to/api/v1/credits")
req = Net::HTTP::Get.new(uri)
req["Cookie"] = "session=your_session_cookie"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(response.body)
puts "Credits remaining: #{data['balance']}"
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://screenshotapi.to/api/v1/credits",
    CURLOPT_COOKIE => "session=your_session_cookie",
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo "Credits remaining: " . $response["balance"] . "\n";

You can also check your balance from the x-credits-remaining response header returned with every screenshot request — no extra API call needed.


List Credit Packs

GET /api/v1/credits/packs

Returns all available credit packs with pricing. This endpoint is public — no authentication required.

Response

[
  {
    "id": "pack_starter",
    "name": "Starter",
    "credits": 1000,
    "priceCents": 900,
    "isPopular": false
  },
  {
    "id": "pack_growth",
    "name": "Growth",
    "credits": 5000,
    "priceCents": 2900,
    "isPopular": true
  },
  {
    "id": "pack_pro",
    "name": "Pro",
    "credits": 25000,
    "priceCents": 9900,
    "isPopular": false
  },
  {
    "id": "pack_scale",
    "name": "Scale",
    "credits": 100000,
    "priceCents": 29900,
    "isPopular": false
  }
]

Fields

FieldTypeDescription
idstringPack identifier (used when purchasing)
namestringHuman-readable pack name
creditsnumberNumber of credits included
priceCentsnumberPrice in US cents (e.g., 2900 = $29.00)
isPopularbooleanWhether this pack is highlighted as the recommended option

Example

curl "https://screenshotapi.to/api/v1/credits/packs"
const response = await fetch('https://screenshotapi.to/api/v1/credits/packs')
const packs = await response.json()

packs.forEach(pack => {
  const price = (pack.priceCents / 100).toFixed(2)
  console.log(`${pack.name}: ${pack.credits} credits for $${price}`)
})
import requests

response = requests.get("https://screenshotapi.to/api/v1/credits/packs")

for pack in response.json():
    price = pack["priceCents"] / 100
    print(f"{pack['name']}: {pack['credits']} credits for ${price:.2f}")
package main

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

func main() {
	req, _ := http.NewRequest("GET", "https://screenshotapi.to/api/v1/credits/packs", nil)
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var packs []struct {
		Name       string `json:"name"`
		Credits    int    `json:"credits"`
		PriceCents int    `json:"priceCents"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&packs); err != nil {
		panic(err)
	}
	for _, pack := range packs {
		price := float64(pack.PriceCents) / 100
		fmt.Printf("%s: %d credits for $%.2f\n", pack.Name, pack.Credits, price)
	}
}
require "net/http"
require "json"

uri = URI("https://screenshotapi.to/api/v1/credits/packs")
req = Net::HTTP::Get.new(uri)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
packs = JSON.parse(response.body)

packs.each do |pack|
  price = pack["priceCents"] / 100.0
  puts "#{pack['name']}: #{pack['credits']} credits for $#{format('%.2f', price)}"
end
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://screenshotapi.to/api/v1/credits/packs",
    CURLOPT_RETURNTRANSFER => true,
]);
$packs = json_decode(curl_exec($ch), true);
curl_close($ch);

foreach ($packs as $pack) {
    $price = $pack["priceCents"] / 100;
    printf(
        "%s: %d credits for $%.2f\n",
        $pack["name"],
        $pack["credits"],
        $price
    );
}

Purchase Credits

POST /api/v1/credits/purchase

Initiates a credit purchase and returns a checkout URL to redirect the user to complete payment. Requires session authentication.

Request Body

FieldTypeRequiredDescription
packIdstringYesThe ID of the credit pack to purchase (from the packs endpoint)

Response

{
  "checkoutUrl": "https://checkout.screenshotapi.to/..."
}

Error Responses

StatusBodyDescription
404{"error": "Credit pack not found"}Pack ID doesn't exist or is inactive

Example

curl -X POST "https://screenshotapi.to/api/v1/credits/purchase" \
  -H "Content-Type: application/json" \
  -d '{"packId": "pack_pro"}' \
  --cookie "session=your_session_cookie"
const response = await fetch('https://screenshotapi.to/api/v1/credits/purchase', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({ packId: 'pack_pro' })
})

const { checkoutUrl } = await response.json()

// In a browser, redirect the user to complete payment
window.location.href = checkoutUrl
import requests

response = requests.post(
    "https://screenshotapi.to/api/v1/credits/purchase",
    json={"packId": "pack_pro"},
    cookies={"session": "your_session_cookie"}
)

checkout_url = response.json()["checkoutUrl"]
print(f"Complete payment at: {checkout_url}")
package main

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

func main() {
	body := bytes.NewBufferString(`{"packId":"pack_pro"}`)
	req, _ := http.NewRequest("POST", "https://screenshotapi.to/api/v1/credits/purchase", body)
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "session", Value: "your_session_cookie"})
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var result struct {
		CheckoutURL string `json:"checkoutUrl"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Printf("Complete payment at: %s\n", result.CheckoutURL)
}
require "net/http"
require "json"

uri = URI("https://screenshotapi.to/api/v1/credits/purchase")
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Cookie"] = "session=your_session_cookie"
req.body = { packId: "pack_pro" }.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(response.body)
puts "Complete payment at: #{data['checkoutUrl']}"
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://screenshotapi.to/api/v1/credits/purchase",
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
    CURLOPT_POSTFIELDS => json_encode(["packId" => "pack_pro"]),
    CURLOPT_COOKIE => "session=your_session_cookie",
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo "Complete payment at: " . $response["checkoutUrl"] . "\n";

Flow

  1. Call /credits/purchase with the desired packId.
  2. Redirect the user to the returned checkoutUrl.
  3. The user completes payment on the hosted checkout page.
  4. Credits are automatically added to the user's balance.
  5. The user is redirected back to the dashboard.

Transaction History

GET /api/v1/credits/transactions

Returns the credit transaction history for the authenticated user. Requires session authentication.

Query Parameters

ParameterTypeDefaultDescription
limitnumber50Number of transactions to return (max 100)
offsetnumber0Number of transactions to skip (for pagination)

Response

Returns an array of transactions ordered by creation date (newest first).

[
  {
    "id": "txn_abc123",
    "type": "usage",
    "amount": -1,
    "description": "Screenshot captured",
    "referenceId": "screenshot_xyz",
    "createdAt": "2026-03-24T15:30:00.000Z"
  },
  {
    "id": "txn_def456",
    "type": "purchase",
    "amount": 1000,
    "description": "Purchased 1,000 credits",
    "referenceId": "checkout_abc123",
    "createdAt": "2026-03-24T12:00:00.000Z"
  },
  {
    "id": "txn_ghi789",
    "type": "subscription",
    "amount": 200,
    "description": "Free tier monthly allowance",
    "referenceId": null,
    "createdAt": "2026-03-20T09:00:00.000Z"
  }
]

Transaction Types

TypeDescription
purchaseCredits purchased via checkout
auto_topupCredits added via automatic top-up
usageCredits deducted for a screenshot (amount is negative)
subscriptionCredits granted by a subscription plan (e.g., 200/month on Free tier)

Example

curl "https://screenshotapi.to/api/v1/credits/transactions?limit=20&offset=0" \
  --cookie "session=your_session_cookie"
const params = new URLSearchParams({ limit: '20', offset: '0' })

const response = await fetch(
  `https://screenshotapi.to/api/v1/credits/transactions?${params}`,
  { credentials: 'include' }
)

const transactions = await response.json()
transactions.forEach(txn => {
  const sign = txn.amount > 0 ? '+' : ''
  console.log(`${txn.type}: ${sign}${txn.amount} — ${txn.description}`)
})
import requests

response = requests.get(
    "https://screenshotapi.to/api/v1/credits/transactions",
    params={"limit": 20, "offset": 0},
    cookies={"session": "your_session_cookie"}
)

for txn in response.json():
    sign = "+" if txn["amount"] > 0 else ""
    print(f"{txn['type']}: {sign}{txn['amount']}{txn['description']}")
package main

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

func main() {
	req, _ := http.NewRequest("GET", "https://screenshotapi.to/api/v1/credits/transactions?limit=20&offset=0", nil)
	req.AddCookie(&http.Cookie{Name: "session", Value: "your_session_cookie"})
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var transactions []struct {
		Type        string `json:"type"`
		Amount      int    `json:"amount"`
		Description string `json:"description"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&transactions); err != nil {
		panic(err)
	}
	for _, txn := range transactions {
		sign := ""
		if txn.Amount > 0 {
			sign = "+"
		}
		fmt.Printf("%s: %s%d%s\n", txn.Type, sign, txn.Amount, txn.Description)
	}
}
require "net/http"
require "json"

uri = URI("https://screenshotapi.to/api/v1/credits/transactions?limit=20&offset=0")
req = Net::HTTP::Get.new(uri)
req["Cookie"] = "session=your_session_cookie"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
transactions = JSON.parse(response.body)

transactions.each do |txn|
  sign = txn["amount"].positive? ? "+" : ""
  puts "#{txn['type']}: #{sign}#{txn['amount']}#{txn['description']}"
end
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://screenshotapi.to/api/v1/credits/transactions?limit=20&offset=0",
    CURLOPT_COOKIE => "session=your_session_cookie",
    CURLOPT_RETURNTRANSFER => true,
]);
$transactions = json_decode(curl_exec($ch), true);
curl_close($ch);

foreach ($transactions as $txn) {
    $sign = $txn["amount"] > 0 ? "+" : "";
    echo "{$txn['type']}: {$sign}{$txn['amount']} — {$txn['description']}\n";
}

On this page