parseapi 1.11.4 → 1.12.0
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 +56 -38
- data/lib/parseapi/client.rb +28 -29
- 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: e450d2df555933d527324ff1c716bc5949850506b286e1107a5a5c446e6b06bc
|
|
4
|
+
data.tar.gz: db86dc5c1c64e5976a60d9cb127fb9f11378b037366991bb28480bd17a27ab1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b33b85ecfb5001ce9ee512d79fab62c62064d5fe8ec630c0544427ceca84964b10b4b113e042bbab85af41eb824b6b20a39ef6739310860e96b79a2e6daec28
|
|
7
|
+
data.tar.gz: 6fe0601a6ef931b39088d2c5f9528b250158d855d120eada69ad8ac5ccc7bf2b02d06e9da9845f3e46041e38a961dab3f7b682d7f16d548b4f080427f9552be6
|
data/README.md
CHANGED
|
@@ -13,13 +13,13 @@ Get a key at [parseapi.com](https://parseapi.com). The client also reads `PARSEA
|
|
|
13
13
|
|
|
14
14
|
## API versions
|
|
15
15
|
|
|
16
|
-
This SDK explicitly selects the API contract supported by this SDK. It sends `
|
|
16
|
+
This SDK explicitly selects the API contract supported by this SDK. It sends `X-API-Version: 2.1.0` on every lookup so responses match the API contract supported by the package. Your key and the team's saved default stay the same. The API still accepts earlier `Parse-Version` request pins.
|
|
17
17
|
|
|
18
18
|
Upgrade the dependency in staging, review the [release notes](https://parseapi.com/docs/releases), and test the application before deploying the same code and dependency version to production. Commit your dependency lockfile so the tested package travels with your deployment. Future major SDK upgrades can select a newer API contract.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Older SDKs keep their existing version selection. Requests without either version header use that default, managed in [Dashboard API version](https://parseapi.com/dashboard/versions). Keep it unchanged while older applications depend on it. Rolling back to an SDK without a version header restores the team default, so rollback only restores the old contract when that default has stayed unchanged.
|
|
21
21
|
|
|
22
|
-
The package owns its supported API version. For direct HTTP integrations, an explicit `
|
|
22
|
+
The package owns its supported API version. For direct HTTP integrations, an explicit `X-API-Version` header selects a supported contract. See [API versions and migration](https://parseapi.com/docs/versioning).
|
|
23
23
|
|
|
24
24
|
## Weather from a postal code
|
|
25
25
|
|
|
@@ -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. `
|
|
45
|
+
Use `parse.postal('28202', country: 'US', deep: true)` for US ZIP tax references. `tax.name` names the levy and `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.
|
|
46
46
|
|
|
47
47
|
## Company directory
|
|
48
48
|
|
|
@@ -57,22 +57,21 @@ unless candidates['next'].nil?
|
|
|
57
57
|
query: 'GitLab', country: 'US', limit: 5, cursor: candidates['next']
|
|
58
58
|
)
|
|
59
59
|
end
|
|
60
|
-
coverage = parse.company_coverage
|
|
61
60
|
```
|
|
62
61
|
|
|
63
62
|
Use at most one selector: `query` for a name, `domain`, `ticker`, or `identifier`; country or exact industry filters also allow discovery without a selector. The API validates selectors and filters. Use `country` to scope candidates, `exchange` with a ticker, and `authority` with an identifier. Search returns `companies` and an opaque `next` cursor. Review candidate identity and match details before choosing a stable Company ID. Pass `next` as `cursor` with the same selector, filters and limit to continue that result set.
|
|
64
63
|
|
|
65
|
-
Directory profiles are plain JSON data.
|
|
64
|
+
Directory profiles are plain JSON data. Optional detail belongs to each company in search results and adds legal/reference detail plus nullable `description`, `logo`, `founded`, and the `social_profiles`, `phone_numbers`, `email_addresses`, `domains` and `sources` collections. A logo is a reported URL. `founded` has `value` and `precision`, distinct from incorporation. Sources identify the website, filing or business register, supported fields and observation/update timestamps. Employee observations retain count, measurement date, organization scope and approximation; null means unknown. Missing, null, empty and unknown fields retain their response values. An empty search is a successful result. Invalid inputs and unknown IDs raise the existing API error.
|
|
66
65
|
|
|
67
|
-
The public-directory service retires national-number Company lookups in both API versions. Use the directory methods with API 2.
|
|
66
|
+
The public-directory service retires national-number Company lookups in both API versions. Use the directory methods with API 2.1.0.
|
|
68
67
|
|
|
69
|
-
Company directory social profiles
|
|
68
|
+
Company directory social profiles include `platform` and `url`. Known handles are included when available; unknown handles may be omitted or returned as null by older servers. Phone and email records use `type` for the source-reported purpose. Earlier response fields remain readable by the client.
|
|
70
69
|
|
|
71
70
|
The recipe requests one candidate page, one explicitly chosen profile and directory coverage, plus a second page when a cursor is returned. Each operation uses the existing retry settings. The number-validation call remains unchanged. `lang` applies to national company-number lookup, while directory calls use the source labels.
|
|
72
71
|
|
|
73
72
|
Discovery example: `parse.company_search(country: 'US', industry: '0700', industry_type: 'sic')`
|
|
74
73
|
|
|
75
|
-
Supply `industry` and `industry_type` together. The supported namespace is `sic`, with an exact four-digit string such as `0700`; leading zeros are meaningful. Country-only discovery is also supported. Filters intersect and may narrow an existing selector. Country matches the profile country, not a headquarters or operating-presence claim. Unknown values do not match a requested filter. Filter-only candidates use `match.field: "filters"` and `match.value: null`; reuse the same filters and limit with a returned cursor.
|
|
74
|
+
Supply `industry` and `industry_type` together. The supported namespace is `sic`, with an exact four-digit string such as `0700`; leading zeros are meaningful. Country-only discovery is also supported. Filters intersect and may narrow an existing selector. Country matches the profile country, not a headquarters or operating-presence claim. Unknown values do not match a requested filter. Filter-only candidates use `match.field: "filters"` and `match.value: null`; reuse the same filters and limit with a returned cursor.
|
|
76
75
|
|
|
77
76
|
|
|
78
77
|
## ISO identifiers
|
|
@@ -108,7 +107,6 @@ parse.company_id('co_caczn6wf36hj', deep: true)
|
|
|
108
107
|
parse.company_search(domain: 'about.gitlab.com')
|
|
109
108
|
parse.company_search(ticker: 'GTLB', exchange: 'Nasdaq')
|
|
110
109
|
parse.company_search(identifier: '0001653482', authority: 'sec')
|
|
111
|
-
parse.company_coverage
|
|
112
110
|
parse.city('charlotte', country: 'US')
|
|
113
111
|
parse.city_id('city_mb8mbqrkz8zb')
|
|
114
112
|
parse.city_search('char', country: 'US', limit: 10)
|
|
@@ -152,13 +150,13 @@ parse.emoji_search('fire')
|
|
|
152
150
|
|
|
153
151
|
The existing NAICS lookup and search methods remain available as compatibility names for Industry.
|
|
154
152
|
|
|
155
|
-
Industry paid deep records include classification `
|
|
153
|
+
Industry paid deep records include classification `exclusions`, each with a description and linked codes. Generic exclusions can have no linked codes. Omitted or null exclusions in older responses remain unknown. Search results also include `match`: the matched `field` (`name`, `term` or `naics`) and `text`, plus `corrections` with `from` and `to` tokens for typo fallback. Corrections are empty for exact, plural and prefix matches. Direct code lookups omit `match`. Older responses may omit it.
|
|
156
154
|
|
|
157
155
|
Each lookup returns a plain hash with string keys. Related lookups are separate calls, such as `country_states('US')`. Reading the result makes no further requests. New response fields and `nil` values are preserved.
|
|
158
156
|
|
|
159
157
|
DNS uses pooled requests on every plan. Omit `type` to check A, AAAA, CNAME, MX, NS, TXT, SOA, CAA, SRV and PTR. Records contain `name`, `type`, `ttl` in seconds and a DNS presentation `value`. TXT values retain quoting and chunk boundaries. A selected question can include its CNAME chain. Empty records mean no records. Lookup failures remain errors.
|
|
160
158
|
|
|
161
|
-
Name paid deep includes flat `short`, `directory`, and `initials` fields beside `gender
|
|
159
|
+
Name paid deep includes flat `short`, `directory`, and `initials` fields beside `gender`. `name_locale` selects CLDR formatting rules and defaults to `en`. It changes formatting only. Country remains gender context, and unavailable formatting is null. Older responses may omit these fields.
|
|
162
160
|
|
|
163
161
|
## Display language
|
|
164
162
|
|
|
@@ -174,7 +172,7 @@ The next call keeps its usual default unless it also supplies `lang`. Existing `
|
|
|
174
172
|
|
|
175
173
|
## Time
|
|
176
174
|
|
|
177
|
-
`time` returns local ISO `at` with its UTC offset and integer Unix seconds in `unix`. The core `offset` preserves exact precision. Optional `
|
|
175
|
+
`time` returns local ISO `at` with its UTC offset and integer Unix seconds in `unix`. The core `offset` preserves exact precision. Optional `offset_seconds` gives the numeric offset, while `offset_minutes` gives whole minutes. Historical offsets and ISO times can include offset seconds. Omitted `at` means now. With `to` or `targets`, an offsetless `at` is source wall time. Otherwise it is UTC. Include an offset for repeated local times around a clock change. Current time and conversion use pooled requests on every plan. Coordinate clock fields can be null when the timezone is unknown. Existing `timezone` methods remain supported.
|
|
178
176
|
|
|
179
177
|
For an offsetless `at` with `to` or `targets`, choose how to handle a clock change with `disambiguation`. It applies to named-zone and coordinate Time calls.
|
|
180
178
|
|
|
@@ -193,7 +191,7 @@ result = parse.time('America/New_York', at: '2026-11-01T01:30:00',
|
|
|
193
191
|
puts result['to']['at'] # 2026-11-01T06:30:00+00:00
|
|
194
192
|
```
|
|
195
193
|
|
|
196
|
-
Canonical Time `deep` includes the pinned rule edition in `
|
|
194
|
+
Canonical Time `deep` includes the pinned rule edition in `timezone_database_version` and source-wall resolution in `resolution`. Resolution records `kind` (`unique`, `overlap` or `gap`), the selected policy, signed `adjustment_seconds`, and chronological alternatives with exact `at`, Unix seconds and UTC offset. Unique times have an empty alternatives list. Explicit instants, current time and lookups without conversion omit resolution. Destination detail stays compact.
|
|
197
195
|
|
|
198
196
|
Search serving IANA IDs by city or region, or omit the query to list all (Go and Rust use an empty string). Discovery returns `timezone_database_version` and sorted `timezones`. No search matches returns `timezones: []`.
|
|
199
197
|
|
|
@@ -221,13 +219,15 @@ Source deep adds `standard_offset`, `standard_offset_seconds`, signed `dst_offse
|
|
|
221
219
|
|
|
222
220
|
## Place statistics and optional detail
|
|
223
221
|
|
|
224
|
-
Country Core contains the everyday reference: `name`, `name_full`, `name_local`, demonym, `iso_alpha3` and `iso_numeric` country identifiers, continent, region and subregion, currency, calling code, `flag`, language and timezone codes, borders, bloc memberships and `capital: { name, latitude, longitude }`. Paid Deep adds specialist detail, including population, total area and national statistics. `gdp_usd` and `gdp_per_capita_usd` are current US dollars; `population_growth_percent`, `urban_population_percent` and `internet_users_percent` use a 0–100 percent scale (growth can be negative or exceed 100). GDP per person and these three percentages round once to two decimals in the API response. `elevation_average` is average terrain elevation in meters; `lowest_point.elevation` and `highest_point.elevation` keep their point-specific meaning. Unknown stays null and a known zero stays zero. Country tax references are grouped once as `
|
|
222
|
+
Country Core contains the everyday reference: `name`, `name_full`, `name_local`, demonym, `iso_alpha3` and `iso_numeric` country identifiers, continent, region and subregion, currency, calling code, `flag`, language and timezone codes, borders, bloc memberships and `capital: { name, latitude, longitude }`. Paid Deep adds specialist detail, including population, total area and national statistics. `gdp_usd` and `gdp_per_capita_usd` are current US dollars; `population_growth_percent`, `urban_population_percent` and `internet_users_percent` use a 0–100 percent scale (growth can be negative or exceed 100). GDP per person and these three percentages round once to two decimals in the API response. `elevation_average` is average terrain elevation in meters; `lowest_point.elevation` and `highest_point.elevation` keep their point-specific meaning. Unknown stays null and a known zero stays zero. Country tax references are grouped once as `tax: { name, rate }`; the rate remains a percentage. Read capital from the Core object and read optional tax references from `tax.name` and `tax.rate` on that same resource.
|
|
223
|
+
|
|
224
|
+
Country includes `postal_format` and `postal_regex` on every plan without requesting Deep. `postal_format` is an input hint based on one example, not a complete mask. `postal_regex` checks syntax, not whether a code exists or receives mail. Unavailable values are null.
|
|
225
225
|
|
|
226
226
|
Australian postal lookups include core `localities` with suburb choices (`city`, `state`, `state_name`) on every plan. Null or an omitted field means unknown, while `[]` means the reviewed reference has no eligible choices. `city` stays null when the source is ambiguous, even if there is only one eligible choice. Let the user select their suburb and keep manual entry available. These are geographic choices, not mailing-address verification. [G-NAF source, adaptations and licence](https://parseapi.com/legal/attribution#postal-au).
|
|
227
227
|
|
|
228
|
-
Postal paid
|
|
228
|
+
Postal paid Deep includes `currency`, `neighbors`, grouped `tax` and `property_tax: { annual_median }`. Property-tax amounts use `currency`. Tax contains `name`, `rate` and the `rate_state`, `rate_county`, `rate_city` and `rate_special` components in percent. Core provides the postal location answer.
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
District paid profiles include `property_tax` where supported. It contains `annual_median`, `currency` and `period`: median annual property tax payable on owner-occupied homes in the statistical area. The amount is adjusted to the final year of the reporting period (`YYYY-YYYY`). This is an area statistic, not a rate or an individual property bill. Unsupported, missing and censored estimates are null.
|
|
231
231
|
|
|
232
232
|
```ruby
|
|
233
233
|
place = parse.postal('28202', country: 'US', deep: true)
|
|
@@ -240,7 +240,7 @@ Country deep includes `land_area` and `water_area` in km2, `coastline` in km, an
|
|
|
240
240
|
|
|
241
241
|
Point returns the timezone ID with the core location. Its optional Deep adds terrain, compact nearest-city context and supported electoral detail on paid plans. Existing accounts retain their current Deep access. A nearest city is null when none is within 200 km.
|
|
242
242
|
|
|
243
|
-
Weather returns current conditions by default. Paid deep adds specialist current measurements, forecasts and related detail.
|
|
243
|
+
Weather returns current conditions by default. Paid deep adds specialist current measurements, forecasts and related detail. On a paid plan, a past `date` adds history for that UTC day alongside current conditions in API 2.1. Earlier contracts require an explicit detail request.
|
|
244
244
|
|
|
245
245
|
```ruby
|
|
246
246
|
parse.weather(40.7128, -74.006, deep: true, date: '2026-08-15')
|
|
@@ -256,29 +256,29 @@ Bank inputs use `POST /bank` JSON bodies, keeping IBAN and account values out of
|
|
|
256
256
|
|
|
257
257
|
## Deep
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
Call the API and get everything your plan includes. API 2.1 paid plans include their profile detail automatically; Free returns the complete everyday answer. Existing explicit `deep` options remain supported for compatibility. Mailbox verification is a separate explicit operation. An omitted or false SDK `deep` option follows the plan default; `true` remains an explicit compatibility request.
|
|
260
260
|
|
|
261
|
-
| Operation |
|
|
261
|
+
| Operation | Included data and explicit checks |
|
|
262
262
|
|---|---|
|
|
263
263
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
264
264
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
265
|
-
| Email |
|
|
265
|
+
| Email | Basic validation is separate. Call the explicit verification method for a metered mailbox check. |
|
|
266
266
|
| Phone, Time, Date, Emoji, Point | Optional detail on paid plans in the same pooled request. Existing accounts retain their current Deep access. |
|
|
267
|
-
| Language | All language facts are in Core;
|
|
268
|
-
| Currency | Currency lookup facts are complete in Core;
|
|
267
|
+
| Language | All language facts are in Core; Deep adds no fields. |
|
|
268
|
+
| Currency | Currency lookup facts are complete in Core; Deep adds no fields. Lookup and exchange-rate conversion use pooled requests. |
|
|
269
269
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
270
270
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
271
271
|
| Company | The complete product detail bag on paid plans. |
|
|
272
272
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
273
|
-
| Carrier, HLR |
|
|
273
|
+
| Carrier, HLR | The selected metered operation returns its complete result by default. No deep option is required. |
|
|
274
274
|
|
|
275
|
-
Email
|
|
275
|
+
Explicit Email verification includes mailbox status and the reason for the result, plus a suggested first name, no-reply flag, plus-address tag and mail service. The suggested name is not a verified identity. Unavailable details are null.
|
|
276
276
|
|
|
277
277
|
Reasons include `accepted`, `invalid_format`, `invalid_domain`, `no_mail_server`, `mailbox_not_found`, `mailbox_disabled`, `mailbox_full`, `catchall`, `disposable`, `temporary_failure`, `rejected` and `unconfirmed`.
|
|
278
278
|
|
|
279
279
|
Carrier, caller, and HLR are separate metered operations. Choose them explicitly when you need their answers. Ordinary lookups retry twice by default. Metered checks use one attempt by default. Setting retries explicitly can repeat paid usage.
|
|
280
280
|
|
|
281
|
-
|
|
281
|
+
With `deep=true`, available extra fields appear at their natural resource homes. Without it, or without access, those optional fields are absent. Included unknown values remain null; false and zero retain their meanings. There is no `deep` response object.
|
|
282
282
|
|
|
283
283
|
```ruby
|
|
284
284
|
ip = parse.ip('52.94.76.10', deep: true)
|
|
@@ -308,7 +308,7 @@ parse = ParseAPI.new(
|
|
|
308
308
|
)
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
Ordinary lookups retry network errors and HTTP 429, 500, 502, 503, and 504 up to twice. Carrier, caller, and HLR lookups, plus
|
|
311
|
+
Ordinary lookups retry network errors and HTTP 429, 500, 502, 503, and 504 up to twice. Carrier, caller, and HLR lookups, plus explicit Email verification, 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.
|
|
312
312
|
|
|
313
313
|
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.
|
|
314
314
|
|
|
@@ -336,7 +336,7 @@ generic logo; a known network without reviewed artwork also uses the generic log
|
|
|
336
336
|
Optional Deep adds `prefix`, `issuer`, `country`, `type` and `prepaid` on paid plans
|
|
337
337
|
in the same pooled request. Existing accounts retain their current Deep access.
|
|
338
338
|
Requested but locked Deep is `{}`. Six or more digits enable directory
|
|
339
|
-
matching. With Deep access, fewer digits return all-null Deep fields. Compare `
|
|
339
|
+
matching. With Deep access, fewer digits return all-null Deep fields. Compare `prefix` with
|
|
340
340
|
`bin`: equal is an exact recorded match; shorter is broader; null is no match.
|
|
341
341
|
The longest row wins, including null fields. `prepaid: null` means unknown, not
|
|
342
342
|
false. This is partial reference data, not card validity or payment acceptance.
|
|
@@ -345,7 +345,7 @@ false. This is partial reference data, not card validity or payment acceptance.
|
|
|
345
345
|
card = parse.card("51")
|
|
346
346
|
puts card["logo"]
|
|
347
347
|
details = parse.card("43737400", deep: true)
|
|
348
|
-
issuer = details["
|
|
348
|
+
issuer = details["issuer"]
|
|
349
349
|
```
|
|
350
350
|
|
|
351
351
|
Leading zeros are preserved. Only ASCII spaces, tabs, CR, LF and hyphens are
|
|
@@ -354,7 +354,7 @@ before dispatch, accepted input is forwarded unchanged. Never send a full card n
|
|
|
354
354
|
|
|
355
355
|
## Optional detail
|
|
356
356
|
|
|
357
|
-
The default response answers the common task. Ask for `deep` when you need more detail about that same result. Core fields stay equal. City, Company directory, Industry and Emoji searches put detail
|
|
357
|
+
The default response answers the common task. Ask for `deep` when you need more detail about that same result. Core fields stay equal. City, Company directory, Industry and Emoji searches put detail at the root of each result. Postal nearby and distance put metropolitan detail beside the entity it describes. Time conversion keeps target detail in `to` or each `targets` item; only the source has `next_dst`.
|
|
358
358
|
|
|
359
359
|
```ruby
|
|
360
360
|
basic = parse.time('America/New_York')
|
|
@@ -372,7 +372,7 @@ Stack checks static homepage HTML and response headers. It returns the checked U
|
|
|
372
372
|
|
|
373
373
|
`cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null. Unknown or conflicting versions are null. Detections describe the checked homepage.
|
|
374
374
|
|
|
375
|
-
Successful checks may be reused for up to 24 hours. `pretty` optionally formats the wire JSON. Stack uses your plan's request allowance and API version 2.
|
|
375
|
+
Successful checks may be reused for up to 24 hours. `pretty` optionally formats the wire JSON. Stack uses your plan's request allowance and API version 2.1.0 selected by this client.
|
|
376
376
|
|
|
377
377
|
Stack defaults to a 35-second transport timeout so a first scan has time to finish. Other lookups retain their 10-second default. An explicit client timeout takes precedence.
|
|
378
378
|
|
|
@@ -391,17 +391,17 @@ GET /emoji/rocket
|
|
|
391
391
|
```
|
|
392
392
|
|
|
393
393
|
Use `deep=true` for Unicode facts, keywords, tone families and available artwork.
|
|
394
|
-
Artwork is keyed by style: `
|
|
395
|
-
`
|
|
394
|
+
Artwork is keyed by style: `artwork.openmoji.svg` is the SVG URL, and
|
|
395
|
+
`artwork.openmoji.png["72"]` is the 72×72 PNG URL (use your language’s map
|
|
396
396
|
access syntax). The same shape applies to `noto` and `twemoji`. Missing styles
|
|
397
397
|
and formats are omitted. URLs pin immutable artwork editions and retain their bytes.
|
|
398
398
|
Core values stay unchanged. Text parsing returns `emojis` with UTF-16 `positions`;
|
|
399
399
|
conversion returns `text` and unresolved tokens with positions and reasons.
|
|
400
400
|
|
|
401
401
|
The compact JSON catalog contains offline identity, qualification-form and
|
|
402
|
-
shortcode indexes.
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
shortcode indexes. Use `lang` for localized names and keywords. Metadata and
|
|
403
|
+
shared source notices are included in the catalog. Read an individual emoji
|
|
404
|
+
with Deep for its artwork links. Artwork supports Google Noto, Twemoji
|
|
405
405
|
and OpenMoji, with real SVG/PNG availability and immutable first-party URLs.
|
|
406
406
|
A device's emoji font remains the ordinary display.
|
|
407
407
|
|
|
@@ -426,7 +426,7 @@ Collections support `name`, `population`, `country` and `elevation`; search also
|
|
|
426
426
|
|
|
427
427
|
## Canonical City operations
|
|
428
428
|
|
|
429
|
-
Classic lookup, search, nearest and named-nearby methods retain their default envelopes and required-field models. Browse and coordinate-nearby
|
|
429
|
+
Classic lookup, search, nearest and named-nearby methods retain their default envelopes and required-field models. Browse uses `cities` and coordinate-nearby uses `nearby`, with nullable `next_cursor` (camelCase properties in Swift/Kotlin). Keep all query options unchanged when continuing a page; no client fetches pages automatically.
|
|
430
430
|
|
|
431
431
|
```ruby
|
|
432
432
|
page = parse.city_search('Viena', format: 'list', match: 'fuzzy', max_distance: 1)
|
|
@@ -434,7 +434,7 @@ children = parse.city_children('city_7aj899nvwyku')
|
|
|
434
434
|
distance = parse.city_distance('city_7aj899nvwyku', 'city_7aj899nvwyku')
|
|
435
435
|
```
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
Each route retains its default response. Country inclusion/exclusion sets, timezone sets, inclusive population and meter-elevation bounds, stored-center `bbox` and signed multi-key sorting are available for collections. Unknown numeric facts do not match range filters.
|
|
438
438
|
|
|
439
439
|
Search defaults to prefix matching. Exact and fuzzy matching are explicit; fuzzy accepts maximum edit distance 1 or 2 and returns `match` evidence (`type`, `source`, `value`, `language`, `edit_distance`). Review a fuzzy choice before storing its ID.
|
|
440
440
|
|
|
@@ -456,8 +456,26 @@ Coverage by country and available fields is described at https://parseapi.com/ci
|
|
|
456
456
|
|
|
457
457
|
Conditional `If-None-Match` reads and GeoJSON currently use HTTP directly. A matching City ETag returns 304 without a body; ordinary billing and rate limits apply. These JSON client methods do not supply conditional-cache handling.
|
|
458
458
|
|
|
459
|
+
IP paid Deep includes supported approximate location, `state_name`, `postal`, `latitude`, `longitude`, `timezone`, routed `network`, `asn_type` and public `proxy` status. Missing facts remain null. Coordinates describe range geography, not device GPS. `asn_type` classifies the origin network, not subscriber connection technology. Proxy/VPN false means unlisted. Optional fields are omitted without the requested detail or access.
|
|
460
|
+
|
|
459
461
|
## Capital coordinate migration
|
|
460
462
|
|
|
461
463
|
Country and State capital coordinates use `latitude` and `longitude`. Update
|
|
462
464
|
`capital.lat` and `capital.lon` reads to `capital.latitude` and
|
|
463
465
|
`capital.longitude` when adopting this release.
|
|
466
|
+
|
|
467
|
+
## API 2.1 upgrade
|
|
468
|
+
|
|
469
|
+
API 2.1 Time returns the clock first and the matched place in `location`. Read that place directly; `location.candidates` is for unresolved choices. Unused `resolution` is absent. City matches keep the match kind, text and language without the source category or spelling score. Holiday JSON keeps scope and completeness without calendar hashes; explicitly selected work-profile pins remain.
|
|
470
|
+
|
|
471
|
+
This client targets ParseAPI 2.1.0. Upgrading requires response-reader changes: optional detail now lives on its resource. Read `population` instead of `deep.population`. Deep remains an explicit request for optional detail. Without the request or access, optional fields are absent. A returned null still means unknown. User-Agent device, OS and browser are objects in every mode. Postal tax is one `tax` object. Specialist Weather measurements live in `current`. Metered Carrier and HLR return the complete purchased result without a Deep switch.
|
|
472
|
+
|
|
473
|
+
Use `parse.email_verify(email)` for mailbox verification. It sends POST `/email/verify` with `{ "email": "person@example.com" }` and defaults to no automatic retries. The earlier Email deep argument is accepted only as a migration alias for that same operation. App keys receive `permission_denied`. Bulk exports retain their existing column names and saved-job recovery.
|
|
474
|
+
|
|
475
|
+
The 2.0 API is a temporary migration bridge for older installed clients. There is one maintained SDK line using the 2.1 structure.
|
|
476
|
+
|
|
477
|
+
## Upgrade to API 2.1
|
|
478
|
+
|
|
479
|
+
This version selects API `2.1.0`. Update existing `.deep` property reads to the fields at their natural homes, such as `country.population`. User-Agent identities are objects; Postal tax and Weather observations keep their documented object homes. Paid plans include their profile detail automatically in API 2.1. Free keeps its complete routine answer, and existing explicit `deep` options remain supported. Mailbox verification stays explicit.
|
|
480
|
+
|
|
481
|
+
**This minor version changes existing field reads.** Upgrade the SDK and your application reads together. Existing factories remain. Email verification is explicit and includes basic validation; Carrier/HLR need no extra detail request. Preserve missing values, `null`, `false` and `0`.
|
data/lib/parseapi/client.rb
CHANGED
|
@@ -19,7 +19,12 @@ module ParseAPI
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
class Client
|
|
22
|
-
API_VERSION = '2.
|
|
22
|
+
API_VERSION = '2.1.0'.freeze
|
|
23
|
+
private def city_format(value)
|
|
24
|
+
raise ArgumentError, 'Use format=geojson or omit format.' unless value.nil? || value == 'geojson'
|
|
25
|
+
value
|
|
26
|
+
end
|
|
27
|
+
|
|
23
28
|
private_constant :API_VERSION
|
|
24
29
|
DEFAULT_BASE_URL = 'https://api.parseapi.com'.freeze
|
|
25
30
|
DEFAULT_TIMEOUT = 10
|
|
@@ -101,16 +106,16 @@ module ParseAPI
|
|
|
101
106
|
end
|
|
102
107
|
|
|
103
108
|
def city(name, country: nil, state: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, aliases: false, ambiguity: nil, format: nil, romanized: false)
|
|
104
|
-
get("/city/#{seg(name)}", country: country, state: state, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, ambiguity: ambiguity, romanized: romanized, format: format)
|
|
109
|
+
get("/city/#{seg(name)}", country: country, state: state, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, ambiguity: ambiguity, romanized: romanized, format: city_format(format))
|
|
105
110
|
end
|
|
106
111
|
|
|
107
112
|
def city_id(id, deep: false, lang: nil, hierarchy: false, format: nil, romanized: false)
|
|
108
|
-
get("/city/id/#{seg(id)}", deep: deep, lang: lang, hierarchy: hierarchy, romanized: romanized, format: format)
|
|
113
|
+
get("/city/id/#{seg(id)}", deep: deep, lang: lang, hierarchy: hierarchy, romanized: romanized, format: city_format(format))
|
|
109
114
|
end
|
|
110
115
|
|
|
111
|
-
def city_search(query, country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, aliases: false, min_population: nil, max_population: nil,
|
|
116
|
+
def city_search(query, country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, aliases: false, min_population: nil, max_population: nil, bbox: nil, sort: nil, page: false, cursor: nil, format: nil, countries: nil, exclude_countries: nil, timezones: nil, min_elevation: nil, max_elevation: nil, match: nil, max_distance: nil, romanized: false)
|
|
112
117
|
spelling = !match.nil? || !max_distance.nil?
|
|
113
|
-
response = get(spelling ? '/city/search' : '/city', q: query, match: match, max_distance: max_distance, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, min_population: min_population, max_population: max_population,
|
|
118
|
+
response = get(spelling ? '/city/search' : '/city', q: query, match: match, max_distance: max_distance, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, min_population: min_population, max_population: max_population, bbox: bbox, sort: sort, page: page, cursor: cursor, romanized: romanized, format: city_format(format), countries: city_csv(countries), exclude_countries: city_csv(exclude_countries), timezones: city_csv(timezones), min_elevation: min_elevation, max_elevation: max_elevation)
|
|
114
119
|
if spelling && format.nil?
|
|
115
120
|
classic = {"q"=>query, "cities"=>response.fetch("data"), "next_cursor"=>response["next_cursor"]}
|
|
116
121
|
classic["country"] = country unless country.nil?
|
|
@@ -121,11 +126,11 @@ module ParseAPI
|
|
|
121
126
|
end
|
|
122
127
|
|
|
123
128
|
def city_nearest(lat, lon, deep: false, lang: nil, country: nil, state: nil, type: nil, grain: nil, hierarchy: false, format: nil, romanized: false)
|
|
124
|
-
get('/city', lat: lat, lon: lon, deep: deep, lang: lang, country: country, state: state, type: type, grain: grain, hierarchy: hierarchy, romanized: romanized, format: format)
|
|
129
|
+
get('/city', lat: lat, lon: lon, deep: deep, lang: lang, country: country, state: state, type: type, grain: grain, hierarchy: hierarchy, romanized: romanized, format: city_format(format))
|
|
125
130
|
end
|
|
126
131
|
|
|
127
|
-
def city_nearby(name, radius: nil, unit: nil, country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, aliases: false, ambiguity: nil, min_population: nil, max_population: nil,
|
|
128
|
-
get("/city/#{seg(name)}/nearby", radius: radius, unit: unit, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, ambiguity: ambiguity, min_population: min_population, max_population: max_population,
|
|
132
|
+
def city_nearby(name, radius: nil, unit: nil, country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, aliases: false, ambiguity: nil, min_population: nil, max_population: nil, bbox: nil, sort: nil, page: false, cursor: nil, format: nil, countries: nil, exclude_countries: nil, timezones: nil, min_elevation: nil, max_elevation: nil, romanized: false)
|
|
133
|
+
get("/city/#{seg(name)}/nearby", radius: radius, unit: unit, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, ambiguity: ambiguity, min_population: min_population, max_population: max_population, bbox: bbox, sort: sort, page: page, cursor: cursor, romanized: romanized, format: city_format(format), countries: city_csv(countries), exclude_countries: city_csv(exclude_countries), timezones: city_csv(timezones), min_elevation: min_elevation, max_elevation: max_elevation)
|
|
129
134
|
end
|
|
130
135
|
|
|
131
136
|
# Look up a postal area. Pass country when known. Check nullable coordinates before another
|
|
@@ -148,13 +153,13 @@ module ParseAPI
|
|
|
148
153
|
end
|
|
149
154
|
|
|
150
155
|
|
|
151
|
-
def city_list(country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, min_population: nil, max_population: nil,
|
|
152
|
-
get('/city', browse: true, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, min_population: min_population, max_population: max_population,
|
|
156
|
+
def city_list(country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, min_population: nil, max_population: nil, bbox: nil, sort: nil, cursor: nil, countries: nil, exclude_countries: nil, timezones: nil, min_elevation: nil, max_elevation: nil, romanized: false)
|
|
157
|
+
get('/city', browse: true, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, min_population: min_population, max_population: max_population, bbox: bbox, sort: sort, cursor: cursor, romanized: romanized, countries: city_csv(countries), exclude_countries: city_csv(exclude_countries), timezones: city_csv(timezones), min_elevation: min_elevation, max_elevation: max_elevation)
|
|
153
158
|
end
|
|
154
159
|
|
|
155
160
|
|
|
156
|
-
def city_nearby_coords(lat, lon, radius: nil, unit: nil, country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, min_population: nil, max_population: nil,
|
|
157
|
-
get('/city', lat: lat, lon: lon, nearby: true, radius: radius, unit: unit, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, min_population: min_population, max_population: max_population,
|
|
161
|
+
def city_nearby_coords(lat, lon, radius: nil, unit: nil, country: nil, state: nil, limit: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, min_population: nil, max_population: nil, bbox: nil, sort: nil, cursor: nil, countries: nil, exclude_countries: nil, timezones: nil, min_elevation: nil, max_elevation: nil, romanized: false)
|
|
162
|
+
get('/city', lat: lat, lon: lon, nearby: true, radius: radius, unit: unit, country: country, state: state, limit: limit, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, min_population: min_population, max_population: max_population, bbox: bbox, sort: sort, cursor: cursor, romanized: romanized, countries: city_csv(countries), exclude_countries: city_csv(exclude_countries), timezones: city_csv(timezones), min_elevation: min_elevation, max_elevation: max_elevation)
|
|
158
163
|
end
|
|
159
164
|
|
|
160
165
|
|
|
@@ -203,23 +208,20 @@ module ParseAPI
|
|
|
203
208
|
get('/company', q: query, domain: domain, ticker: ticker, identifier: identifier, country: country, exchange: exchange, authority: authority, limit: limit, cursor: cursor, deep: deep, industry: industry, industry_type: industry_type)
|
|
204
209
|
end
|
|
205
210
|
|
|
206
|
-
# Read the directory edition and source coverage.
|
|
207
|
-
def company_coverage
|
|
208
|
-
get('/company/directory/coverage')
|
|
209
|
-
end
|
|
210
|
-
|
|
211
211
|
# Parse an email and check its format and domain. Deep explicitly requests a metered
|
|
212
212
|
# deliverability check. Deep checks use one attempt by default. An explicit retry count can
|
|
213
213
|
# repeat paid usage.
|
|
214
214
|
def email(email, deep: false)
|
|
215
|
-
get("/email/#{seg(email)}"
|
|
215
|
+
deep ? email_verify(email) : get("/email/#{seg(email)}")
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Run one explicit metered mailbox check, without automatic retries.
|
|
219
|
+
def email_verify(email)
|
|
220
|
+
get('/email/verify', {}, {}, { email: email })
|
|
216
221
|
end
|
|
217
222
|
|
|
218
223
|
|
|
219
224
|
|
|
220
|
-
def bin(bin, deep: false)
|
|
221
|
-
get("/bin/#{seg(bin)}", deep: deep)
|
|
222
|
-
end
|
|
223
225
|
|
|
224
226
|
|
|
225
227
|
|
|
@@ -370,7 +372,7 @@ module ParseAPI
|
|
|
370
372
|
|
|
371
373
|
# Get current conditions in metric and imperial units. Paid deep adds specialist current
|
|
372
374
|
# measurements, forecasts and related detail. With deep, date selects a past UTC day (YYYY-MM-
|
|
373
|
-
# DD) in
|
|
375
|
+
# DD) in history alongside current conditions. Date alone does not request history.
|
|
374
376
|
def weather(lat, lon, deep: false, date: nil)
|
|
375
377
|
get('/weather', lat: lat, lon: lon, deep: deep, date: date)
|
|
376
378
|
end
|
|
@@ -388,13 +390,10 @@ module ParseAPI
|
|
|
388
390
|
end
|
|
389
391
|
|
|
390
392
|
# Download the full filtered JSON catalog, including offline resolution maps.
|
|
391
|
-
def emoji_catalog(
|
|
392
|
-
get('/emoji/catalog',
|
|
393
|
+
def emoji_catalog(lang: nil, category: nil, subcategory: nil, version: nil, max_version: nil, include_skin_tones: nil)
|
|
394
|
+
get('/emoji/catalog', lang: lang, category: category, subcategory: subcategory, version: version, max_version: max_version, include_skin_tones: include_skin_tones.nil? ? nil : include_skin_tones.to_s)
|
|
393
395
|
end
|
|
394
396
|
|
|
395
|
-
def emoji_metadata
|
|
396
|
-
get('/emoji/metadata')
|
|
397
|
-
end
|
|
398
397
|
|
|
399
398
|
def emoji_categories
|
|
400
399
|
get('/emoji/categories')
|
|
@@ -477,7 +476,7 @@ module ParseAPI
|
|
|
477
476
|
end
|
|
478
477
|
|
|
479
478
|
def request_headers(extra)
|
|
480
|
-
{ 'X-API-Key' => @api_key, 'User-Agent' => "parseapi-ruby/#{VERSION}" }.merge(extra).merge('
|
|
479
|
+
{ 'X-API-Key' => @api_key, 'User-Agent' => "parseapi-ruby/#{VERSION}" }.merge(extra).merge('X-API-Version' => API_VERSION)
|
|
481
480
|
end
|
|
482
481
|
|
|
483
482
|
# Returns [status, headers_hash, body_string]. Overridden in tests.
|
|
@@ -530,7 +529,7 @@ module ParseAPI
|
|
|
530
529
|
return @retries unless @retries.nil?
|
|
531
530
|
|
|
532
531
|
product = path.split('/', 3)[1]
|
|
533
|
-
metered = METERED_CORE.include?(product) || (%w[email vat address].include?(product) && params[:deep] == true)
|
|
532
|
+
metered = path == '/email/verify' || METERED_CORE.include?(product) || (%w[email vat address].include?(product) && params[:deep] == true)
|
|
534
533
|
metered ? 0 : DEFAULT_RETRIES
|
|
535
534
|
end
|
|
536
535
|
|
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.
|
|
4
|
+
version: 1.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ParseAPI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|