apiverve_zipcodes 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -4
- data/lib/apiverve_zipcodes/client.rb +2 -2
- data/lib/apiverve_zipcodes.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2de64b9e567986f694182b2eebe8b820ef0c8f83d3fda003eff95a957fbef8d
|
|
4
|
+
data.tar.gz: a3aa10b17e68a66c04f1f9d8db530900b39ed8cdc7fb493d642afbb2ebe39318
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f3acba691fc80153b7a48c7cc92b2b62d1c25c284d293bab5b63499ae40700a084875f8ee4358cef79c6ed96962fbdcfbcbc4884d0c2d40b83668767f02682e
|
|
7
|
+
data.tar.gz: d44bfd4a94e3b6e31a5dcf1b97dc03be42f9edb5c5c62df1067b2fa1614b32ce3d67b8edff8892d4c7caffa5cce05c3aca97c98f7ca5541a13231e39b2573f6e
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zip Codes Lookup API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add geographic coordinates.
|
|
3
|
+
Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Every ZIP also returns its primary county. Paid plans add the county and state FIPS codes, every county a ZIP crosses with its land share, the IANA time zone, geographic coordinates and the distance from the ZIP to a second ZIP.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -35,7 +35,10 @@ require 'apiverve_zipcodes'
|
|
|
35
35
|
client = APIVerve::Zipcodes::Client.new(api_key: "YOUR_API_KEY")
|
|
36
36
|
|
|
37
37
|
# Make a request
|
|
38
|
-
response = client.execute({
|
|
38
|
+
response = client.execute({
|
|
39
|
+
zip: "64082",
|
|
40
|
+
distanceTo: "64106"
|
|
41
|
+
})
|
|
39
42
|
|
|
40
43
|
# Print the response
|
|
41
44
|
puts response
|
|
@@ -46,7 +49,7 @@ puts response
|
|
|
46
49
|
|
|
47
50
|
```ruby
|
|
48
51
|
begin
|
|
49
|
-
response = client.execute({ zip: "64082" })
|
|
52
|
+
response = client.execute({ zip: "64082", distanceTo: "64106" })
|
|
50
53
|
puts response["data"]
|
|
51
54
|
rescue APIVerve::Zipcodes::ValidationError => e
|
|
52
55
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -78,7 +81,30 @@ client = APIVerve::Zipcodes::Client.new(
|
|
|
78
81
|
"latitude": "38.850243",
|
|
79
82
|
"longitude": "-94.39570",
|
|
80
83
|
"city": "Lees Summit",
|
|
81
|
-
"state": "Missouri"
|
|
84
|
+
"state": "Missouri",
|
|
85
|
+
"timezone": "America/Chicago",
|
|
86
|
+
"county": "Jackson County",
|
|
87
|
+
"countyFips": "29095",
|
|
88
|
+
"stateFips": "29",
|
|
89
|
+
"counties": [
|
|
90
|
+
{
|
|
91
|
+
"name": "Jackson County",
|
|
92
|
+
"fips": "29095",
|
|
93
|
+
"landShare": 0.9077
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "Cass County",
|
|
97
|
+
"fips": "29037",
|
|
98
|
+
"landShare": 0.0923
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"distance": {
|
|
102
|
+
"zipcode": "64106",
|
|
103
|
+
"city": "Kansas City",
|
|
104
|
+
"state_abbr": "MO",
|
|
105
|
+
"miles": 19.94,
|
|
106
|
+
"kilometers": 32.09
|
|
107
|
+
}
|
|
82
108
|
}
|
|
83
109
|
}
|
|
84
110
|
```
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Zipcodes::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ zip: "64082" })
|
|
13
|
+
# response = client.execute({ zip: "64082", distanceTo: "64106" })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/zipcodes?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'zip' => { type: 'string', required: true, min_length: 5, max_length: 5 } }
|
|
22
|
+
VALIDATION_RULES = { 'zip' => { type: 'string', required: true, min_length: 5, max_length: 5 }, 'distanceTo' => { type: 'string', required: false, min_length: 5, max_length: 5 } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
data/lib/apiverve_zipcodes.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_zipcodes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -58,7 +58,10 @@ dependencies:
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '2.0'
|
|
60
60
|
description: Zip Codes Lookup finds all postal codes within a US city or resolves
|
|
61
|
-
a five-digit ZIP code to its city and state.
|
|
61
|
+
a five-digit ZIP code to its city and state. Every ZIP also returns its primary
|
|
62
|
+
county. Paid plans add the county and state FIPS codes, every county a ZIP crosses
|
|
63
|
+
with its land share, the IANA time zone, geographic coordinates and the distance
|
|
64
|
+
from the ZIP to a second ZIP.
|
|
62
65
|
email:
|
|
63
66
|
- hello@apiverve.com
|
|
64
67
|
executables: []
|