Free numbers

Public numbers and their SMS — client.free. No API key needed.

list

Countries, the numbers of the selected country and the SMS of the selected number, in one call.

list(country: nil, number: nil, page: nil, count: nil) # => Hash
OptionTypeDefaultDescription
country:Integer44 (server)Country code; an unknown one falls back to the first available.
number:Stringfirst numberNumber without the country code, as the keys of "numbers".
page:Integer1Page of "messages".
count:Integerserver defaultSMS per page, 10–500.

Result:

  • "countries": [{"country", "country_text", "country_original"}]
  • "numbers": {short_number => {"country", "country_original", "full_number", "data_humans", "is_archive"}}
  • "messages": a paginator of {"id", "text", "in_number", "my_number", "code", "created_at", "data_humans"} plus "number" and "country"; code is - when no code was found
numbers = client.free.list(country: 44)["numbers"]
short = numbers.keys.first
if short
  messages = client.free.list(country: 44, number: short, count: 20)["messages"]
  messages["data"].each { |sms| puts sms.values_at("in_number", "code", "text").join(" ") }
end