Sign inGet Started

List available phone numbers

GET
/v1/numbers/available
// The search is always country-scoped, so country_code is required.
const page = await bird.numbers.available.list({
  country_code: "GB",
  capabilities: ["sms", "voice"],
});
for (const candidate of page.data) {
  console.log(candidate.number, candidate.number_type);
}
Odpowiedź200
{
  "data": [
    {
      "country_code": "US",
      "number_type": "mobile",
      "capabilities": [
        "sms"
      ],
      "ownership_address_scope": "anywhere",
      "pricing": {
        "setup_price": {
          "amount": "0.00995",
          "currency_code": "USD"
        },
        "recurring_price": {
          "amount": "0.00995",
          "currency_code": "USD"
        },
        "recurring_period": {
          "unit": "month",
          "count": 1
        },
        "intervals_per_charge": 12
      }
    }
  ],
  "next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}

Returns phone numbers available for purchase in a country. Narrow the search with number_type, capabilities, and prefix. Inventory numbers come first and support pagination. The final page can include a live snapshot of numbers available from suppliers.

Inventory results are newest first by default. When you specify number_type and the suppliers on sale in the market are ranked into multiple priority tiers, results follow supplier priority, newest first within each tier. These searches reject ending_before and return neither prev_cursor nor refresh_cursor, so backward and refresh paging are unavailable. Country-only searches and markets with a single tier keep newest-first inventory ordering and support backward and refresh paging.

Parametry zapytania

country_codestring

ISO 3166-1 alpha-2 country code to search in.

number_typestring

Return only numbers of this physical type after applying the country and prefix filters.

Possible values (may grow over time): mobile, local, national, short_code, short_code_fteu, toll_free

prefixstring

Return only numbers that start with these digits, matched right after the country dial code: with country_code=US, prefix=212 matches +1 212 area-code numbers and prefix=833 matches 833 toll-free numbers. Digits only. Leave out the country dial code and any national dialing prefix such as a leading 0. Short codes never match a prefix search.

capabilitiesarray

Filter by capability. Repeat the parameter to require several at once: capabilities=sms&capabilities=voice returns only numbers that support both.

limitinteger

Maximum number of items to return per page.

starting_afterstring

Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.

ending_beforestring

Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.

Treść odpowiedzi

data
array of object
wymagane
Pokaż atrybuty podrzędne
data.number
string
wymagane

Phone number in E.164 format.

data.country_code
string
wymagane

ISO 3166-1 alpha-2 country code.

data.number_type
string
wymagane

Physical type of this phone number.

Possible values (may grow over time): mobile, local, national, short_code, short_code_fteu, toll_free

data.capabilities
array of string
wymagane

Capabilities supported by this number.

data.ownership_registration_required
boolean
wymagane

Whether ownership paperwork must be approved before outbound SMS and voice use. Customer availability accounts for organization exemptions; admin supplier searches report the general country and number-type requirement. You can acquire the number, including Bird stock, and submit paperwork afterward. Any pricing.setup_price is charged during purchase, plus any tax. The recurring charge, net of tax pricing.recurring_price multiplied by pricing.intervals_per_charge, is taken with any tax at assignment and at each renewal, even while approval is pending; assignment may follow completion of a pending supplier order.

data.ownership_address_scope
string

Where the carrier requires the business address on this number's ownership registration to be. Present only when the carrier itself registers the number before it carries traffic and states a rule; omitted otherwise. An address that does not meet the rule is refused after purchase, and only an address that meets it can fix the registration.

  • anywhere: any business address.
  • country: a business address in the number's country.
  • number_area: a business address inside the number's own area code, for example in Amsterdam for an Amsterdam (020) number.

Possible values (may grow over time): anywhere, country, number_area

data.pricing
object

What your organization pays for this number. Omitted on admin supplier searches, which have no organization to price for.

Pokaż atrybuty podrzędne
data.pricing.setup_price
nullable object
wymagane

One-off setup fee for your organization, net of tax, in your billing currency. Its amount is "0" when the published fee is zero. null when no setup fee applies to this country and number type, and whenever recurring_price is null.

Pokaż atrybuty podrzędne
data.pricing.recurring_price
nullable object
wymagane

What your organization is charged for this number per recurring_period, net of tax, in your billing currency, after your agreed prices are applied. null when the number cannot be priced for your organization, because its recurring price or a required setup fee has no price; it cannot be ordered then.

Pokaż atrybuty podrzędne
data.pricing.recurring_price.amount
string
wymagane

Decimal amount as a string, in major currency units.

data.pricing.recurring_price.currency_code
string
wymagane

ISO 4217 currency code.

data.pricing.recurring_period
nullable object
wymagane

The period recurring_price covers. null when recurring_price is null.

Pokaż atrybuty podrzędne
data.pricing.intervals_per_charge
nullable integer
wymagane

How many recurring_periods one charge bills at once. Your organization is charged recurring_price multiplied by this at purchase and at each renewal. null when recurring_price is null.

next_cursor
nullable string
wymagane

Cursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.

prev_cursor
nullable string
wymagane

Cursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.

refresh_cursor
nullable string
wymagane

Refresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.

Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.