parseapi 1.10.1 → 1.10.3
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 +6 -53
- data/lib/parseapi/client.rb +0 -51
- data/lib/parseapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5d77aa0696ab480d22cfd25418d327958794636f2ccbfa0e3ef49caf1b4adfc
|
|
4
|
+
data.tar.gz: 90937689e56a2b1657c255b206817058650d1462823b8b3d0a8825e0f791ef98
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca73d21823c8bc5e0a9c9c1b493e9960527dff057a7e1e5a6e9fa1c46398c33d6cfa30075dcd5d4fbf2aa2a69be84989f699d782e160600e2e8cd0d0e6726f2f
|
|
7
|
+
data.tar.gz: ff49b8c7f444731da4d4160a2882fd1c7c791b77fb52c233b0f6d776aa35c9afe6cebb04acf72bc0e807c2693fd737de568134df772d4d86fc57c5f23ad9748d
|
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,7 @@ 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
|
-
parse.bank('DE89370400440532013000')
|
|
86
84
|
parse.card('424242')
|
|
87
|
-
parse.provider('1881018208')
|
|
88
85
|
parse.phone('+14155552671')
|
|
89
86
|
parse.carrier('+14155552671')
|
|
90
87
|
parse.caller('+14155552671')
|
|
@@ -114,8 +111,6 @@ parse.state_districts('NC', country: 'US')
|
|
|
114
111
|
parse.district('37081')
|
|
115
112
|
parse.continent('NA')
|
|
116
113
|
parse.continent_countries('NA')
|
|
117
|
-
parse.bloc('EU')
|
|
118
|
-
parse.bloc_countries('SCHENGEN')
|
|
119
114
|
parse.currency('USD')
|
|
120
115
|
parse.currency_rate('USD', 'EUR')
|
|
121
116
|
parse.language('en')
|
|
@@ -143,8 +138,6 @@ parse.dns('_dmarc.example.com', type: 'TXT')
|
|
|
143
138
|
parse.useragent(ua_string)
|
|
144
139
|
parse.industry('541511')
|
|
145
140
|
parse.industry_search('coffee shop', limit: 5)
|
|
146
|
-
parse.tariff('8471.30.01.00', origin: 'CN', deep: true)
|
|
147
|
-
parse.tariff_search('sunglasses')
|
|
148
141
|
parse.emoji('rocket')
|
|
149
142
|
parse.emoji_search('fire')
|
|
150
143
|
```
|
|
@@ -167,7 +160,7 @@ Choose display names for one request:
|
|
|
167
160
|
parse.country('DE', lang: 'fr')
|
|
168
161
|
```
|
|
169
162
|
|
|
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
|
|
163
|
+
`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
164
|
|
|
172
165
|
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
166
|
|
|
@@ -254,49 +247,13 @@ Weather returns current conditions by default. Paid deep adds specialist current
|
|
|
254
247
|
parse.weather(40.7128, -74.006, deep: true, date: '2026-08-15')
|
|
255
248
|
```
|
|
256
249
|
|
|
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
250
|
|
|
271
251
|
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
252
|
|
|
273
253
|
HLR reports status at the last check. `live` means assigned and `connected` means reachable at that check. Cached results may be returned. Null means unconfirmed. Deep diagnostics stay within the same metered lookup.
|
|
274
254
|
|
|
275
|
-
Bank returns core `checks` for input, country, length, structure, checksum and national rules, plus an `issues` list. States are `passed`, `failed`, `not_checked` or `not_supported`. Unsupported national checking is not a failure. `valid` covers the implemented format and checksum rules, not account existence, ownership or payment reachability. Directory names and BICs may be null independently. Older responses may omit `checks` and `issues`, and future states and issue codes remain strings. Pass the original input unchanged so the API can report invalid characters. Deep `account` remains the BBAN remainder.
|
|
276
|
-
|
|
277
255
|
Bank inputs use `POST /bank` JSON bodies, keeping IBAN and account values out of request URLs. Pass original strings; the server owns normalization and validation. Avoid logging request bodies. IBAN deep can include `directory` with the immutable `edition`, resolved `country` and actual `match` grain (`bank`, `branch`, `prefix` or `none`); it is absent if no directory lookup ran. A match does not prove complete country coverage or payment reachability.
|
|
278
256
|
|
|
279
|
-
Use country requirements to build supported input fields. US ACH has an explicit helper with no deep option. It checks the routing format/ABA checksum and account-field syntax; `account_checksum` is `not_supported`. It preserves account characters and leading zeros. A nullable bank name is routing-directory identity, not account existence, ownership or ACH eligibility. The examples below are synthetic test inputs, not payment instructions.
|
|
280
|
-
|
|
281
|
-
```ruby
|
|
282
|
-
parse.bank_requirements('US', format: 'us_ach')
|
|
283
|
-
parse.bank_us_ach(routing: '011000015', account: '0001234567')
|
|
284
|
-
```
|
|
285
|
-
|
|
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
257
|
|
|
301
258
|
## Deep
|
|
302
259
|
|
|
@@ -307,12 +264,10 @@ Choose enrichment for the question you need answered.
|
|
|
307
264
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
308
265
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
309
266
|
| Email | A metered mailbox check with deliverability, catch-all, status, reason and address hints, using included email checks or enabled on-demand usage. |
|
|
310
|
-
|
|
|
311
|
-
| Phone, Time, Date, Currency, Language, Emoji, Bank, Point | Optional detail in the same pooled request on every plan. |
|
|
267
|
+
| Phone, Time, Date, Currency, Language, Emoji, Point | Optional detail in the same pooled request on every plan. |
|
|
312
268
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
313
269
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
314
|
-
|
|
|
315
|
-
| Tariff, Company | The complete product detail bag on paid plans. |
|
|
270
|
+
| Company | The complete product detail bag on paid plans. |
|
|
316
271
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
317
272
|
| Carrier, HLR | Optional diagnostic detail within the same metered core unit, including Free allowance units. No second gate or additional check. |
|
|
318
273
|
|
|
@@ -352,7 +307,7 @@ parse = ParseAPI.new(
|
|
|
352
307
|
)
|
|
353
308
|
```
|
|
354
309
|
|
|
355
|
-
Ordinary lookups retry network errors and HTTP 429, 500, 502, 503, and 504 up to twice. Carrier, caller, and HLR lookups, plus email
|
|
310
|
+
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
311
|
|
|
357
312
|
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
313
|
|
|
@@ -362,7 +317,7 @@ Reuse one client for successive lookups. Call `parse.close` to release its conne
|
|
|
362
317
|
|
|
363
318
|
Network failures raise native Ruby exceptions. An invalid JSON response raises `JSON::ParserError`.
|
|
364
319
|
|
|
365
|
-
For testing or instrumentation, pass a callable as `transport:`. For GET it receives the URL and request-header hash. For
|
|
320
|
+
For testing or instrumentation, pass a callable as `transport:`. For GET it receives the URL and request-header hash. For JSON POST it also receives a third `"POST"` argument and fourth serialized JSON body argument. Accept optional method/body parameters when supplying a custom transport. It returns `[status, lowercase_response_headers, body]`. Custom transports should use the supplied headers and keep redirect following disabled.
|
|
366
321
|
|
|
367
322
|
Requires Ruby 3.0 or later. Standard library only, zero dependencies.
|
|
368
323
|
|
|
@@ -467,7 +422,6 @@ Collection options include minimum and maximum population, an exact IANA timezon
|
|
|
467
422
|
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
423
|
|
|
469
424
|
|
|
470
|
-
|
|
471
425
|
## Canonical City operations
|
|
472
426
|
|
|
473
427
|
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 +441,6 @@ Reviewed children, ancestors and siblings use canonical lists with partial relat
|
|
|
487
441
|
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
442
|
|
|
489
443
|
|
|
490
|
-
|
|
491
444
|
Reviewed name forms:
|
|
492
445
|
|
|
493
446
|
```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,28 +215,13 @@ 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
|
-
def iban(iban, country: nil, deep: false)
|
|
232
|
-
get("/iban/#{seg(iban)}", country: country, deep: deep)
|
|
233
|
-
end
|
|
234
219
|
|
|
235
220
|
def bin(bin, deep: false)
|
|
236
221
|
get("/bin/#{seg(bin)}", deep: deep)
|
|
237
222
|
end
|
|
238
223
|
|
|
239
|
-
def npi(npi, deep: false, lang: nil)
|
|
240
|
-
get("/npi/#{seg(npi)}", deep: deep, lang: lang)
|
|
241
|
-
end
|
|
242
224
|
|
|
243
|
-
def bank(iban, country: nil, deep: false)
|
|
244
|
-
get("/bank", {}, {}, { iban: iban, country: country, deep: deep }.reject { |_key, value| value.nil? })
|
|
245
|
-
end
|
|
246
225
|
|
|
247
226
|
# Look up a 2-11 digit card prefix, preserving leading zeros.
|
|
248
227
|
def card(bin, deep: false)
|
|
@@ -251,19 +230,8 @@ module ParseAPI
|
|
|
251
230
|
end
|
|
252
231
|
|
|
253
232
|
|
|
254
|
-
# US routing/account syntax only; not account or ACH eligibility verification.
|
|
255
|
-
def bank_us_ach(routing:, account:)
|
|
256
|
-
get('/bank', {}, {}, { format: 'us_ach', country: 'US', routing: routing, account: account })
|
|
257
|
-
end
|
|
258
233
|
|
|
259
|
-
# Describe accepted fields and check scope, not directory completeness.
|
|
260
|
-
def bank_requirements(country, format: nil)
|
|
261
|
-
get('/bank/requirements', country: country, format: format)
|
|
262
|
-
end
|
|
263
234
|
|
|
264
|
-
def provider(npi, deep: false, lang: nil)
|
|
265
|
-
get("/provider/#{seg(npi)}", deep: deep, lang: lang)
|
|
266
|
-
end
|
|
267
235
|
|
|
268
236
|
# Parse a phone number and its formats. Pass country for national numbers when needed. Deep
|
|
269
237
|
# adds numbering-plan geography on every plan. Carrier, caller, and HLR are separate metered lookups.
|
|
@@ -341,17 +309,7 @@ module ParseAPI
|
|
|
341
309
|
get('/industry', q: query, limit: limit, deep: deep)
|
|
342
310
|
end
|
|
343
311
|
|
|
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
312
|
|
|
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
313
|
|
|
356
314
|
def currency(code, deep: false, lang: nil)
|
|
357
315
|
get("/currency/#{seg(code)}", deep: deep, lang: lang)
|
|
@@ -498,16 +456,7 @@ module ParseAPI
|
|
|
498
456
|
targets.join(',')
|
|
499
457
|
end
|
|
500
458
|
|
|
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
459
|
|
|
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
460
|
|
|
512
461
|
|
|
513
462
|
def seg(value)
|
data/lib/parseapi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parseapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.10.
|
|
4
|
+
version: 1.10.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ParseAPI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|