parseapi 1.10.1 → 1.10.2
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 +4 -42
- data/lib/parseapi/client.rb +0 -37
- data/lib/parseapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80dac1fcdd566a5fc6727f941052b2ad35e05760826ad0100ebe2005ea0ced28
|
|
4
|
+
data.tar.gz: 2b6dcaac8d08ab828eee5aa196f4d5f4fdb9451bb6a4dab10112ad6415ab0f16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 704c8c350a83c97df89e355d79491206d9b9c184f7d25b446bdac25c6587f83c5e60cf27134162c4591a8685bc9b73d8376125f2abf416b9311832f7a6f9ccc3
|
|
7
|
+
data.tar.gz: 3afc44b68d977c8c09bec265d2a57d37de68aabf22cb6e2798a78e85119e140ed4de46583f55715e08593efc07c6a5c2766a4c1b9e268562681b29dae0faaf21
|
data/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Pass `country` when a postal code or national phone number needs disambiguation.
|
|
|
42
42
|
|
|
43
43
|
Results are plain data. Pass a returned code or coordinate to another operation when the task needs it. Check nullable values before composing the next call.
|
|
44
44
|
|
|
45
|
-
Use `parse.postal('28202', country: 'US', deep: true)` for US ZIP tax references. `deep.tax` names the levy and `deep.tax_rate` is a percentage, so `7.9` means 7.9%. The state, county, city and special components explain that combined rate. An exact address can differ. Country and state lookups provide their own geographic reference rates, which should not be added to the ZIP rate. `nil` means unknown and `0` means known zero. Country `deep.tax_id_format` and `deep.tax_id_regex` describe registration-number format only. Use
|
|
45
|
+
Use `parse.postal('28202', country: 'US', deep: true)` for US ZIP tax references. `deep.tax` names the levy and `deep.tax_rate` is a percentage, so `7.9` means 7.9%. The state, county, city and special components explain that combined rate. An exact address can differ. Country and state lookups provide their own geographic reference rates, which should not be added to the ZIP rate. `nil` means unknown and `0` means known zero. Country `deep.tax_id_format` and `deep.tax_id_regex` describe registration-number format only. Use for a metered registration check with `deep` explicitly enabled.
|
|
46
46
|
|
|
47
47
|
## Company directory
|
|
48
48
|
|
|
@@ -81,10 +81,8 @@ One method per endpoint, named after the route.
|
|
|
81
81
|
parse.ip('8.8.8.8')
|
|
82
82
|
parse.ip_self
|
|
83
83
|
parse.email('hello@gmail.com')
|
|
84
|
-
parse.vat('DE136695976')
|
|
85
84
|
parse.bank('DE89370400440532013000')
|
|
86
85
|
parse.card('424242')
|
|
87
|
-
parse.provider('1881018208')
|
|
88
86
|
parse.phone('+14155552671')
|
|
89
87
|
parse.carrier('+14155552671')
|
|
90
88
|
parse.caller('+14155552671')
|
|
@@ -114,8 +112,6 @@ parse.state_districts('NC', country: 'US')
|
|
|
114
112
|
parse.district('37081')
|
|
115
113
|
parse.continent('NA')
|
|
116
114
|
parse.continent_countries('NA')
|
|
117
|
-
parse.bloc('EU')
|
|
118
|
-
parse.bloc_countries('SCHENGEN')
|
|
119
115
|
parse.currency('USD')
|
|
120
116
|
parse.currency_rate('USD', 'EUR')
|
|
121
117
|
parse.language('en')
|
|
@@ -143,8 +139,6 @@ parse.dns('_dmarc.example.com', type: 'TXT')
|
|
|
143
139
|
parse.useragent(ua_string)
|
|
144
140
|
parse.industry('541511')
|
|
145
141
|
parse.industry_search('coffee shop', limit: 5)
|
|
146
|
-
parse.tariff('8471.30.01.00', origin: 'CN', deep: true)
|
|
147
|
-
parse.tariff_search('sunglasses')
|
|
148
142
|
parse.emoji('rocket')
|
|
149
143
|
parse.emoji_search('fire')
|
|
150
144
|
```
|
|
@@ -167,7 +161,7 @@ Choose display names for one request:
|
|
|
167
161
|
parse.country('DE', lang: 'fr')
|
|
168
162
|
```
|
|
169
163
|
|
|
170
|
-
`lang` is optional on geography lookups and their lists/searches, Currency lookup, Language, Date, Time/Timezone, Emoji lookup/search, and unit discovery. IP, ASN
|
|
164
|
+
`lang` is optional on geography lookups and their lists/searches, Currency lookup, Language, Date, Time/Timezone, Emoji lookup/search, and unit discovery. IP, ASN and national Company number lookups also accept it for their geographic labels. Codes, native names, quantities and response structure retain their meanings. Source coverage determines which labels are translated; unavailable labels use the API's documented fallback.
|
|
171
165
|
|
|
172
166
|
The next call keeps its usual default unless it also supplies `lang`. Existing `deep` rules still apply. Date `format` and measurement `locale` remain explicit input-parsing controls.
|
|
173
167
|
|
|
@@ -254,19 +248,6 @@ Weather returns current conditions by default. Paid deep adds specialist current
|
|
|
254
248
|
parse.weather(40.7128, -74.006, deep: true, date: '2026-08-15')
|
|
255
249
|
```
|
|
256
250
|
|
|
257
|
-
Tariff starts with the general schedule line. Paid deep adds units and the special and other schedule columns. An optional origin then resolves country-specific measures. The three calls below show those successive choices. Without origin, schedule detail is still returned and origin-dependent fields are null. A null effective rate is not a zero rate.
|
|
258
|
-
|
|
259
|
-
Tariff lookup and search accept the `edition` ID returned by Tariff, such as `ted_3`, and an optional `date` (`YYYY-MM-DD`). The edition pins exact immutable source bytes. A date is accepted only when verified source coverage exists. An edition without a date returns undated schedule context (`date: null`). Default requests use today. Paid detail exposes an open-string `reason` when `effective_rate` is null, including `incomplete_coverage`. A null rate never means zero. Explicit selections fail with `tariff_selection_mismatch` if an older server ignores the requested scope.
|
|
260
|
-
|
|
261
|
-
Origin means where the goods originate, not where they ship from. The effective rate covers matched stored schedule measures only. It is not complete duty or landed cost.
|
|
262
|
-
|
|
263
|
-
Codes contain 4, 6, 8 or 10 ASCII digits; dots and whitespace are optional. Search returns up to 20 description matches with parent `lineage` so a result named "Other" has context. Search is not product classification. In deep, `measures: null` means origin-dependent measures were not resolved. `measures: []` means the resolved lookup found none.
|
|
264
|
-
|
|
265
|
-
```ruby
|
|
266
|
-
parse.tariff('8471.30.01.00')
|
|
267
|
-
parse.tariff('8471.30.01.00', deep: true)
|
|
268
|
-
parse.tariff('8471.30.01.00', deep: true, origin: 'CN')
|
|
269
|
-
```
|
|
270
251
|
|
|
271
252
|
Address search uses context from the form: prefer postal, or city and state. An optional end-user `ip` is a locality hint for server-side calls. An empty result explains itself with `reason`: `more_input`, `missing_context` or `no_matches`. With suggestions, reason is null. Older responses may omit it, and future reasons remain strings. Catalog and lookup failures use the existing API errors.
|
|
272
253
|
|
|
@@ -283,21 +264,6 @@ parse.bank_requirements('US', format: 'us_ach')
|
|
|
283
264
|
parse.bank_us_ach(routing: '011000015', account: '0001234567')
|
|
284
265
|
```
|
|
285
266
|
|
|
286
|
-
## Provider lookup
|
|
287
|
-
|
|
288
|
-
```ruby
|
|
289
|
-
provider = parse.provider('1881018208')
|
|
290
|
-
profile = parse.provider('1881018208', deep: true)
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
Pass the original NPI as a string. `valid` checks its format and checksum; `registered` means a match in the stored NPPES snapshot. `active` reflects recorded NPI deactivation, not licensure. `excluded` is an NPI-only OIG LEIE match; `false` is not a complete exclusion clearance. These directory facts do not verify credentials, current practice contact or payment eligibility.
|
|
294
|
-
|
|
295
|
-
Invalid input returns `valid: false` with unknown provider fields. A checksum-valid number missing from the snapshot returns `registered: false`; unavailable storage remains an API error. Preserve `null` as unknown.
|
|
296
|
-
|
|
297
|
-
The default pooled lookup includes provider identity, specialty and practice contact where held. Paid `deep` adds `deactivated_at`, `medicare`, `opt_out` and `enrollments` from stored source files, with no separate check meter or live verification. `enrollments: null` means unavailable; `[]` means no enrollment rows are returned. The API omits unrequested `deep` and returns `{}` when requested on Free.
|
|
298
|
-
|
|
299
|
-
Paid Deep also returns `taxonomies` in published order, with taxonomy code, specialty label, primary flag and provider-reported license number/state, plus `enumerated_at`, `updated_at` and `reactivated_at` record dates. Reported licenses are not verified licenses. Null lists mean unavailable; empty lists mean the edition contains no entries. Provider record dates describe the provider record. Unknown dates stay null.
|
|
300
|
-
|
|
301
267
|
## Deep
|
|
302
268
|
|
|
303
269
|
Choose enrichment for the question you need answered.
|
|
@@ -307,12 +273,10 @@ Choose enrichment for the question you need answered.
|
|
|
307
273
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
308
274
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
309
275
|
| Email | A metered mailbox check with deliverability, catch-all, status, reason and address hints, using included email checks or enabled on-demand usage. |
|
|
310
|
-
| VAT | A metered registry check where supported, using included VAT checks or enabled on-demand usage. |
|
|
311
276
|
| Phone, Time, Date, Currency, Language, Emoji, Bank, Point | Optional detail in the same pooled request on every plan. |
|
|
312
277
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
313
278
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
314
|
-
|
|
|
315
|
-
| Tariff, Company | The complete product detail bag on paid plans. |
|
|
279
|
+
| Company | The complete product detail bag on paid plans. |
|
|
316
280
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
317
281
|
| Carrier, HLR | Optional diagnostic detail within the same metered core unit, including Free allowance units. No second gate or additional check. |
|
|
318
282
|
|
|
@@ -352,7 +316,7 @@ parse = ParseAPI.new(
|
|
|
352
316
|
)
|
|
353
317
|
```
|
|
354
318
|
|
|
355
|
-
Ordinary lookups retry network errors and HTTP 429, 500, 502, 503, and 504 up to twice. Carrier, caller, and HLR lookups, plus email
|
|
319
|
+
Ordinary lookups retry network errors and HTTP 429, 500, 502, 503, and 504 up to twice. Carrier, caller, and HLR lookups, plus email with `deep: true`, make one attempt by default because repeating them can repeat paid usage. Address with `deep: true` also uses one attempt, reserving that behavior for future verification. This does not mean address deep currently has a separate charge.
|
|
356
320
|
|
|
357
321
|
Pass `retries: 0` to make every lookup a single attempt. An explicit count such as `retries: 2` applies to every lookup, including paid ones. A retried request can count toward usage even when the first response was lost. Omit `retries` or pass `nil` to use the defaults above.
|
|
358
322
|
|
|
@@ -467,7 +431,6 @@ Collection options include minimum and maximum population, an exact IANA timezon
|
|
|
467
431
|
Collections support `name`, `population`, `country` and `elevation`; search also supports `relevance`, and nearby supports `distance`. Combine up to three signed terms, for example `sort=-population,name`. A signed multi-key sort does not also take `order`. Population defaults to descending order; other sorts default to ascending. Set `order` to `asc` or `desc`, except relevance only supports ascending. Named nearby uses country and state to select the anchor; population, timezone and bounding box filter the returned neighbors. Coordinate nearby applies country and state to its returned cities.
|
|
468
432
|
|
|
469
433
|
|
|
470
|
-
|
|
471
434
|
## Canonical City operations
|
|
472
435
|
|
|
473
436
|
Classic lookup, search, nearest and named-nearby methods retain their default envelopes and required-field models. Browse and coordinate-nearby use canonical lists: `object`, `data` and nullable `next_cursor` (camelCase properties in Swift/Kotlin). Keep all query options unchanged when continuing a page; no client fetches pages automatically.
|
|
@@ -487,7 +450,6 @@ Reviewed children, ancestors and siblings use canonical lists with partial relat
|
|
|
487
450
|
Strict `ambiguity=error` can return HTTP 409 `ambiguous_city` with up to two safe candidate identities. The existing error constructor and unrelated error metadata are preserved; candidates are retained only for that status/code and never contain Deep. GeoJSON is available through HTTP; these typed City list methods do not return GeoJSON.
|
|
488
451
|
|
|
489
452
|
|
|
490
|
-
|
|
491
453
|
Reviewed name forms:
|
|
492
454
|
|
|
493
455
|
```ruby
|
data/lib/parseapi/client.rb
CHANGED
|
@@ -78,13 +78,7 @@ module ParseAPI
|
|
|
78
78
|
get("/continent/#{seg(code)}/countries", lang: lang)
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
def bloc(code)
|
|
82
|
-
get("/bloc/#{seg(code)}")
|
|
83
|
-
end
|
|
84
81
|
|
|
85
|
-
def bloc_countries(code, lang: nil)
|
|
86
|
-
get("/bloc/#{seg(code)}/countries", lang: lang)
|
|
87
|
-
end
|
|
88
82
|
|
|
89
83
|
def country(code, deep: false, lang: nil)
|
|
90
84
|
get("/country/#{seg(code)}", deep: deep, lang: lang)
|
|
@@ -221,12 +215,6 @@ module ParseAPI
|
|
|
221
215
|
get("/email/#{seg(email)}", deep: deep)
|
|
222
216
|
end
|
|
223
217
|
|
|
224
|
-
# Check VAT format and checksum. Deep requests a metered registry check where supported. Deep
|
|
225
|
-
# checks use one attempt by default. Supply your own VAT number for a consultation reference
|
|
226
|
-
# when supported.
|
|
227
|
-
def vat(number, country: nil, deep: false, from: nil)
|
|
228
|
-
get("/vat/#{seg(number)}", country: country, deep: deep, from: from)
|
|
229
|
-
end
|
|
230
218
|
|
|
231
219
|
def iban(iban, country: nil, deep: false)
|
|
232
220
|
get("/iban/#{seg(iban)}", country: country, deep: deep)
|
|
@@ -236,9 +224,6 @@ module ParseAPI
|
|
|
236
224
|
get("/bin/#{seg(bin)}", deep: deep)
|
|
237
225
|
end
|
|
238
226
|
|
|
239
|
-
def npi(npi, deep: false, lang: nil)
|
|
240
|
-
get("/npi/#{seg(npi)}", deep: deep, lang: lang)
|
|
241
|
-
end
|
|
242
227
|
|
|
243
228
|
def bank(iban, country: nil, deep: false)
|
|
244
229
|
get("/bank", {}, {}, { iban: iban, country: country, deep: deep }.reject { |_key, value| value.nil? })
|
|
@@ -261,9 +246,6 @@ module ParseAPI
|
|
|
261
246
|
get('/bank/requirements', country: country, format: format)
|
|
262
247
|
end
|
|
263
248
|
|
|
264
|
-
def provider(npi, deep: false, lang: nil)
|
|
265
|
-
get("/provider/#{seg(npi)}", deep: deep, lang: lang)
|
|
266
|
-
end
|
|
267
249
|
|
|
268
250
|
# Parse a phone number and its formats. Pass country for national numbers when needed. Deep
|
|
269
251
|
# adds numbering-plan geography on every plan. Carrier, caller, and HLR are separate metered lookups.
|
|
@@ -341,17 +323,7 @@ module ParseAPI
|
|
|
341
323
|
get('/industry', q: query, limit: limit, deep: deep)
|
|
342
324
|
end
|
|
343
325
|
|
|
344
|
-
# Look up the general US duty schedule line. Paid deep adds units and the special and other
|
|
345
|
-
# schedule columns. Add origin with deep to resolve country-specific measures. Without origin,
|
|
346
|
-
# schedule detail remains available and origin-dependent fields are null. A null effective rate
|
|
347
|
-
# is not a zero rate.
|
|
348
|
-
def tariff(code, deep: false, origin: nil, edition: nil, date: nil)
|
|
349
|
-
tariff_selection(get("/tariff/#{seg(code)}", deep: deep, origin: origin, edition: edition, date: date), edition, date)
|
|
350
|
-
end
|
|
351
326
|
|
|
352
|
-
def tariff_search(query, edition: nil, date: nil)
|
|
353
|
-
tariff_selection(get('/tariff', q: query, edition: edition, date: date), edition, date)
|
|
354
|
-
end
|
|
355
327
|
|
|
356
328
|
def currency(code, deep: false, lang: nil)
|
|
357
329
|
get("/currency/#{seg(code)}", deep: deep, lang: lang)
|
|
@@ -498,16 +470,7 @@ module ParseAPI
|
|
|
498
470
|
targets.join(',')
|
|
499
471
|
end
|
|
500
472
|
|
|
501
|
-
def tariff_edition_id?(value)
|
|
502
|
-
value.is_a?(String) && (/\A[a-f0-9]{64}\z/.match?(value) || (/\Ated_[1-9][0-9]{0,19}\z/.match?(value) && (value.bytesize < 24 || value[4..-1] <= '18446744073709551615')))
|
|
503
|
-
end
|
|
504
473
|
|
|
505
|
-
def tariff_selection(result, edition, date)
|
|
506
|
-
if (!edition.nil? || !date.nil?) && (!tariff_edition_id?(result['edition']) || (!edition.nil? && result['edition'] != edition) || result['date'] != date)
|
|
507
|
-
raise Error.new(status: 0, code: 'tariff_selection_mismatch', message: 'Tariff response did not confirm the requested edition/date. The server may not support this selection.')
|
|
508
|
-
end
|
|
509
|
-
result
|
|
510
|
-
end
|
|
511
474
|
|
|
512
475
|
|
|
513
476
|
def seg(value)
|
data/lib/parseapi/version.rb
CHANGED