Skip to main content
Skip to content
ScrapingBuddyDevelopers
On this page Prepare your account

SMS API/Guides

Your first number

Go from a server-side API key to an allocated number and your first verification message.

Prepare your account

Sign in, top up your wallet and create an API key in API access. Save the key when it is shown; it cannot be revealed again.

Set SCRAPINGBUDDY_API_KEY in your server environment. First call GET /balance to verify authentication without placing an order. All amounts are integer USD cents; 100 cents is $1.00.

Check your connection
curl "https://www.scrapingbuddy.com/api/v1/balance" \
  -H "Authorization: Bearer $SCRAPINGBUDDY_API_KEY"

Choose a country and service

Call List countries and use a returned country ID with List services. Use the service id as product, not its display name.

For a specific operator, call List operators with the same country and product. Otherwise omit operator when quoting, or pass any. Catalogue prices and stock are indicative.

  1. GET /countries
  2. GET /services?country=england
  3. Optional: GET /operators?country=england&product=google

Check a live quote

POST /quotes with country, product and optional operator. Inspect amountCents and compare it against a budget that you control.

Save the quote id and check expiresAt. Quotes last two minutes and do not reserve stock. If the price is too high, stop; do not purchase.

Request a quote
curl -X POST "https://www.scrapingbuddy.com/api/v1/quotes" \
  -H "Authorization: Bearer $SCRAPINGBUDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"england","product":"google","operator":"any"}'

Purchase exactly once

Generate one UUID v4 for this purchase and persist it with the approved quote ID before making the request. Set them as SCRAPINGBUDDY_PURCHASE_KEY and SCRAPINGBUDDY_QUOTE_ID in the examples below.

This request spends wallet funds. If the connection fails or times out, reuse the same saved key and quote ID. Never generate another key just because you did not receive a response.

POST /orders
# Set SCRAPINGBUDDY_API_KEY in your server environment.
# Persist these values before purchase; reuse them on an uncertain retry.
# SCRAPINGBUDDY_QUOTE_ID: your approved quote ID.
# SCRAPINGBUDDY_PURCHASE_KEY: one saved UUID v4 for this purchase.

curl -X POST "https://www.scrapingbuddy.com/api/v1/orders" \
  -H "Authorization: Bearer $SCRAPINGBUDDY_API_KEY" \
  -H "Idempotency-Key: $SCRAPINGBUDDY_PURCHASE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quoteId":"'"$SCRAPINGBUDDY_QUOTE_ID"'"}'

Receive the SMS and finish

Retrieve GET /orders/{id} every 10 seconds while the order is active. Use the returned phone number for your intended verification flow. Read order.sms to detect a message.

After receiving and using the message, POST /orders/{id}/finish. To cancel an active order before an SMS arrives, use POST /orders/{id}/cancel. Check refunded_at to confirm a recorded refund.

If status is purchase_unknown, do not create a replacement purchase automatically. Keep the order ID and contact support.

SMS API v1
Getting startedIntroductionYour first numberAuthentication
Integration guidesOrder lifecycle & messagesSafe purchases & retriesErrors & limits

Explore the documentation

SMS APIIntroduction

Virtual numbers, quotes, verification messages and order management.

GuidesYour first number

Go from a server-side API key to an allocated number and your first verification message.

GuidesAuthentication

Create a customer key and connect your backend securely.

GuidesOrder lifecycle & messages

Know when a number is ready, when a message has arrived and when to stop polling.

GuidesSafe purchases & retries

Recover uncertain requests without accidentally buying another number.

GuidesErrors & limits

Understand response errors and the limits shared by your account.

GET /balanceGet balance

Read the wallet balance shared by your dashboard and API purchases. balanceUsd is the exact available USD balance as a decimal string, including fractional cents from CAPTCHA charg

GET /countriesList countries

Find the country identifiers used by catalogue and purchase requests. Use the id from this response in subsequent requests. Country names and dialling prefixes are display informat

GET /servicesList services

Find service IDs, stock and indicative prices for a country. Catalogue prices are indicative, not a purchase commitment. Always create a fresh quote before purchasing. Stock can ch

GET /operatorsList operators

Find available operators for a country and service. Pass an operator id to Create a quote when you need a specific operator. Omit operator or use any for automatic selection. Chang

POST /quotesCreate a quote

Get a live price before committing to a number purchase. A quote expires after two minutes. Check amountCents against your budget and expiresAt before purchasing. A quote does not

POST /ordersCreate an order

Purchase a number using an approved quote and a persisted idempotency key. This request spends wallet funds. Persist a UUID v4 Idempotency-Key and quoteId before sending it. Reuse

GET /ordersList orders

Read your order history, newest first, in pages of up to 20 orders. Start with offset=0 and increase by 20 while hasMore is true. Stop when hasMore is false. This is offset paginat

GET /orders/{id}Get an order

Retrieve an allocated number, its current status and all received messages. Poll every 10 seconds while the order is active. Background checks continue even if your application dis

POST /orders/{id}/refreshRefresh an order

Request a status check for an existing order. Checks are throttled and also run automatically in the background. Repeated refresh requests do not guarantee a fresh provider request

POST /orders/{id}/cancelCancel an order

Cancel an active order before an SMS has arrived. Only cancel when the order is active and sms is empty. The server checks whether the action is still allowed. Check refunded_at to

POST /orders/{id}/finishFinish an order

Complete an active order after receiving and using your SMS. Finish only after the sms array contains a message. This action ends the order; keep the message you need before finish