Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grokify/gophonenumbers

API Client and CLI app for numverify.com to verify phone number and list countries.
https://github.com/grokify/gophonenumbers

cli cli-command cli-utility go go-cli go-client

Last synced: about 2 months ago
JSON representation

API Client and CLI app for numverify.com to verify phone number and list countries.

Awesome Lists containing this project

README

        

GoPhoneNumbers
==============

[![Build Status][build-status-svg]][build-status-url]
[![Go Report Card][goreport-svg]][goreport-url]
[![Docs][docs-godoc-svg]][docs-godoc-url]
[![License][license-svg]][license-url]

This library provides phone number information functionality including ability to access number look up APIs. It includes a Go client and CLI app for the Numverify API, and Twilio API.

https://numverify.com/documentation

## Installation

| Install | Command |
|---------|---------|
| SDK only | `$ go get github.com/grokify/gophonenumbers` |
| CLI only | `$ go get github.com/grokify/gophonenumbers/apps/numverify` |
| SDK and CLI | `$ go get github.com/grokify/gophonenumbers/...` |

## Usage

### CLI App

| Options | Long | Short | Example |
|---------|------|-------|---------|
| `.env` File | `--env` | `-e` | `-e=/path/to/.env` |
| Access Token | `--token` | `-t` | `-t=` |
| Validate Number | `--number` | `-n` | `-n=` |
| List Countries | `--countries` | `-c` | `-c` |

#### Example Commands

```
$ numverify -e=/path/to/.env -n=+16505550100
$ numverify -t= -n=+16505550100
$ numverify -e=/path/to/.env -c
$ numverify -t= -c
```

### SDK

#### Validate Number

```go
import(
nv "github.com/grokify/gophonenumbers/numverify"
)

func main() {
client := nv.NumverifyClient{AccessKey: "myAccessKey"}

apiSuccessInfo, apiErrorInfo, resp, err := client.Validate(
nv.NumverifyParams{Number: number})

[...]
}
```

#### Get Countries

```go
import(
nv "github.com/grokify/gophonenumbers/numverify"
)

func main() {
client := nv.NumverifyClient{AccessKey: "myAccessKey"}

countries, apiErrorInfo, resp, err := client.Countries()

[...]
}
```

[build-status-svg]: https://github.com/grokify/gophonenumbers/workflows/test/badge.svg
[build-status-url]: https://github.com/grokify/gophonenumbers/actions
[goreport-svg]: https://goreportcard.com/badge/github.com/grokify/gophonenumbers
[goreport-url]: https://goreportcard.com/report/github.com/grokify/gophonenumbers
[docs-godoc-svg]: https://pkg.go.dev/badge/github.com/grokify/gophonenumbers
[docs-godoc-url]: https://pkg.go.dev/github.com/grokify/gophonenumbers
[license-svg]: https://img.shields.io/badge/license-MIT-blue.svg
[license-url]: https://github.com/grokify/gophonenumbers/blob/master/LICENSE