crawlora-bbb 0.4.0 → 0.5.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/CHANGELOG.md +1 -1
- data/README.md +3 -2
- data/lib/crawlora/bbb/client.rb +7 -3
- data/lib/crawlora/bbb/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1af592216d77fc8d6d5ddf48a06b1bd5736654e8d872f312078fa5f361b2702d
|
|
4
|
+
data.tar.gz: 3108200c52e4b134ef18a119a6ccd51a4b104526cc8be0535bea754e67a06f80
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64c91fcf051b52a99ba7c6fd31eff7baea51cd69a0790f84327f9fe27f3faf5837762d964cc888b073a7e083bbc72e1a1546316fcb97a1f8f08356d982988b0f
|
|
7
|
+
data.tar.gz: 9edbe7b27a33474c624f9edb277f75cc7467bdd7e548feed3b0bf3dd69f5c7643db7b7d2b5eb8193e3cef747bd2bb9b5524a8664458654b411f287338eb53050
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Crawlora Better Business Bureau API client for Ruby (`crawlora-bbb`)
|
|
2
2
|
|
|
3
|
-
This Ruby gem calls Crawlora's hosted Better Business Bureau API at `https://api.crawlora.net/api/v1`. It exposes
|
|
3
|
+
This Ruby gem calls Crawlora's hosted Better Business Bureau API at `https://api.crawlora.net/api/v1`. It exposes 17 endpoints covering business search, profiles, complaints, reviews, categories, and ScamTracker reports; it does not call or scrape Better Business Bureau directly. Requests require your Crawlora API key and use your account's service plan.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ puts result
|
|
|
20
20
|
client.close
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Use an operation-specific method for normal calls. `request(operation_id, params = {}, response_type: :auto)` is available for every operation. `response_type: :text` returns raw response text. This gem includes
|
|
23
|
+
Use an operation-specific method for normal calls. `request(operation_id, params = {}, response_type: :auto)` is available for every operation. `response_type: :text` returns raw response text. This gem includes 17 API operations.
|
|
24
24
|
|
|
25
25
|
```ruby
|
|
26
26
|
client = Crawlora::Bbb::Client.new(api_key: ENV.fetch("CRAWLORA_API_KEY"), timeout: 30)
|
|
@@ -46,6 +46,7 @@ Browse every route included in this gem. The [endpoint reference](https://github
|
|
|
46
46
|
| `GET` | `/bbb/local-bbbs` | `bbb-local-bbbs` | List local BBB chapters serving a region |
|
|
47
47
|
| `GET` | `/bbb/news` | `bbb-news` | Get BBB newsroom stories |
|
|
48
48
|
| `GET` | `/bbb/news/topics` | `bbb-news-topics` | List BBB newsroom topics |
|
|
49
|
+
| `GET` | `/bbb/page` | `bbb-page` | Get a BBB evergreen page |
|
|
49
50
|
| `GET` | `/bbb/regions` | `bbb-regions` | List Better Business Bureau directory regions |
|
|
50
51
|
| `GET` | `/bbb/scamtracker/search` | `bbb-scamtracker-search` | Search Better Business Bureau Scam Tracker reports |
|
|
51
52
|
| `GET` | `/bbb/scamtracker/state-stats` | `bbb-scamtracker-state-stats` | Get Better Business Bureau Scam Tracker state/province aggregate stats |
|
data/lib/crawlora/bbb/client.rb
CHANGED
|
@@ -19,17 +19,17 @@ module Crawlora
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
OPERATIONS = JSON.parse(<<~'JSON').freeze
|
|
22
|
-
{"bbb-article": {"bodyParam": null, "bodyRequired": false, "id": "bbb-article", "method": "GET", "params": [{"description": "Canonical BBB article URL", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/article/news-releases/34935-bbb-scam-alert-dont-be-fooled-by-free-gas-and-grocery-card-postcards"}], "path": "/bbb/article", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-business": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}], "path": "/bbb/business", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-business-complaints": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business-complaints", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}, {"default": 1, "description": "Complaint list page, 1 or greater (10 complaints per page, newest first). Defaults to 1", "in": "query", "minimum": 1, "name": "page", "type": "integer", "x-example": 1}], "path": "/bbb/business/complaints", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}], "security": ["ApiKeyAuth"]}, "bbb-business-more-info": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business-more-info", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}], "path": "/bbb/business/more-info", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-business-reviews": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business-reviews", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}, {"description": "Result page (10 per page), default 1", "in": "query", "name": "page", "type": "integer"}], "path": "/bbb/business/reviews", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}], "security": ["ApiKeyAuth"]}, "bbb-category": {"bodyParam": null, "bodyRequired": false, "id": "bbb-category", "method": "GET", "params": [{"description": "BBB category browse URL, from a bbb-search result's related_categories", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/category/plumber"}, {"description": "Result page, default 1", "in": "query", "name": "page", "type": "integer"}, {"description": "Sort order", "enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"description": "Maximum distance in miles; omit for all distances", "enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "description": "One or more BBB rating buckets", "in": "query", "items": {"enum": ["A", "B", "C", "D", "F"], "type": "string"}, "name": "rating", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped category ID from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped state or province code from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "state", "type": "array"}, {"description": "Only BBB-accredited businesses", "in": "query", "name": "accredited", "type": "boolean"}, {"description": "Only businesses offering quote requests", "in": "query", "name": "get_quote", "type": "boolean"}, {"description": "Only businesses serving the searched area", "in": "query", "name": "service_area", "type": "boolean"}], "path": "/bbb/category", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}, {"enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "enum": ["A", "B", "C", "D", "F"], "in": "query", "name": "rating", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "state", "type": "array"}, {"in": "query", "name": "accredited", "type": "boolean"}, {"in": "query", "name": "get_quote", "type": "boolean"}, {"in": "query", "name": "service_area", "type": "boolean"}], "security": ["ApiKeyAuth"]}, "bbb-local-bbb": {"bodyParam": null, "bodyRequired": false, "id": "bbb-local-bbb", "method": "GET", "params": [{"description": "Canonical BBB chapter URL from bbb-local-bbbs or a business record's local_bbb_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/local-bbb/bbb-serving-the-heart-of-texas"}], "path": "/bbb/local-bbb", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-local-bbbs": {"bodyParam": null, "bodyRequired": false, "id": "bbb-local-bbbs", "method": "GET", "params": [{"description": "Country code from bbb-regions", "enum": ["us", "ca"], "in": "query", "name": "country", "required": true, "type": "string", "x-example": "us"}, {"description": "Two-letter region code from bbb-regions", "in": "query", "name": "region", "required": true, "type": "string", "x-example": "tx"}], "path": "/bbb/local-bbbs", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["us", "ca"], "in": "query", "name": "country", "required": true, "type": "string"}, {"in": "query", "name": "region", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-news": {"bodyParam": null, "bodyRequired": false, "id": "bbb-news", "method": "GET", "params": [{"description": "Canonical BBB newsroom or topic page URL; include page=N for pagination", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/news/scams?page=2"}], "path": "/bbb/news", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-news-topics": {"bodyParam": null, "bodyRequired": false, "id": "bbb-news-topics", "method": "GET", "params": [{"description": "Canonical BBB newsroom page URL", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/news"}], "path": "/bbb/news/topics", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-regions": {"bodyParam": null, "bodyRequired": false, "id": "bbb-regions", "method": "GET", "params": [], "path": "/bbb/regions", "pathParams": [], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "bbb-scamtracker-detail": {"bodyParam": null, "bodyRequired": false, "id": "bbb-scamtracker-detail", "method": "GET", "params": [{"description": "BBB Scam Tracker report id, from a bbb-scamtracker-search result's id or url", "in": "path", "name": "id", "required": true, "type": "string", "x-example": "1397968"}], "path": "/bbb/scamtracker/{id}", "pathParams": ["id"], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "bbb-scamtracker-search": {"bodyParam": null, "bodyRequired": false, "id": "bbb-scamtracker-search", "method": "GET", "params": [{"description": "Free-text search (phone number, website, email, business name, scam ID, description). Omit to browse the most-recent feed", "in": "query", "name": "query", "type": "string", "x-example": "amazon"}, {"description": "Scam category filter", "enum": ["Advance Fee Loan", "Bank/Credit Card Company Imposter", "Business Email Compromise", "Charity", "Counterfeit Product", "COVID-19", "Credit Cards", "Credit Repair/Debt Relief", "CryptoCurrency", "Debt Collections", "Employment", "Fake Check/Money Order", "Fake Invoice/Supplier Bill", "Family/Friend Emergency", "Foreign Money Exchange", "Government Agency Imposter", "Government Grant", "Healthcare/Medicaid/Medicare", "Home Improvement", "Identity Theft", "Investment", "Moving", "Online Purchase", "Other", "Phishing", "Rental", "Retail Business", "Romance", "Scholarship", "Sweepstakes/Lottery/Prizes", "Tax Collection", "Tech Support", "Travel/Vacation/Timeshare", "Utility", "Vanity Award", "Worthless Problem-solving Service", "Yellow Pages/Directories"], "in": "query", "name": "scam_type", "type": "string"}, {"description": "Optional 2-letter targeted-victim state/province code (US state or Canadian province)", "in": "query", "name": "state", "type": "string", "x-example": "TX"}, {"description": "Optional 2-letter reported-scammer state/province code (US state or Canadian province) -- where the scammer is reported to be, not the victim", "in": "query", "name": "scammer_state", "type": "string", "x-example": "NY"}, {"description": "Optional report-date range start (YYYY-MM-DD), inclusive. Must be set together with date_to", "in": "query", "name": "date_from", "type": "string", "x-example": "2026-01-01"}, {"description": "Optional report-date range end (YYYY-MM-DD), inclusive. Must be set together with date_from", "in": "query", "name": "date_to", "type": "string", "x-example": "2026-01-31"}, {"description": "Optional minimum reported dollar loss. Must be set together with max_dollars_lost", "in": "query", "name": "min_dollars_lost", "type": "integer", "x-example": 500000}, {"description": "Optional maximum reported dollar loss. Must be set together with min_dollars_lost", "in": "query", "name": "max_dollars_lost", "type": "integer", "x-example": 1000000}, {"description": "Result page (10 per page), default 1", "in": "query", "name": "page", "type": "integer"}], "path": "/bbb/scamtracker/search", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "query", "type": "string"}, {"enum": ["Advance Fee Loan", "Bank/Credit Card Company Imposter", "Business Email Compromise", "Charity", "Counterfeit Product", "COVID-19", "Credit Cards", "Credit Repair/Debt Relief", "CryptoCurrency", "Debt Collections", "Employment", "Fake Check/Money Order", "Fake Invoice/Supplier Bill", "Family/Friend Emergency", "Foreign Money Exchange", "Government Agency Imposter", "Government Grant", "Healthcare/Medicaid/Medicare", "Home Improvement", "Identity Theft", "Investment", "Moving", "Online Purchase", "Other", "Phishing", "Rental", "Retail Business", "Romance", "Scholarship", "Sweepstakes/Lottery/Prizes", "Tax Collection", "Tech Support", "Travel/Vacation/Timeshare", "Utility", "Vanity Award", "Worthless Problem-solving Service", "Yellow Pages/Directories"], "in": "query", "name": "scam_type", "type": "string"}, {"in": "query", "name": "state", "type": "string"}, {"in": "query", "name": "scammer_state", "type": "string"}, {"in": "query", "name": "date_from", "type": "string"}, {"in": "query", "name": "date_to", "type": "string"}, {"in": "query", "name": "min_dollars_lost", "type": "integer"}, {"in": "query", "name": "max_dollars_lost", "type": "integer"}, {"in": "query", "name": "page", "type": "integer"}], "security": ["ApiKeyAuth"]}, "bbb-scamtracker-state-stats": {"bodyParam": null, "bodyRequired": false, "id": "bbb-scamtracker-state-stats", "method": "GET", "params": [{"description": "Aggregation window, default 90", "enum": ["30", "90", "365", "all"], "in": "query", "name": "period", "type": "string"}], "path": "/bbb/scamtracker/state-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["30", "90", "365", "all"], "in": "query", "name": "period", "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-search": {"bodyParam": null, "bodyRequired": false, "id": "bbb-search", "method": "GET", "params": [{"description": "Business name or category/service keyword", "in": "query", "name": "query", "required": true, "type": "string", "x-example": "plumber"}, {"description": "City and state (e.g. 'Austin, TX') or a ZIP code", "in": "query", "name": "location", "required": true, "type": "string", "x-example": "Austin, TX"}, {"description": "Result page, default 1", "in": "query", "name": "page", "type": "integer"}, {"default": "USA", "description": "BBB country code", "enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"description": "Sort order", "enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"description": "Maximum distance in miles; omit for all distances", "enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "description": "One or more BBB rating buckets", "in": "query", "items": {"enum": ["A", "B", "C", "D", "F"], "type": "string"}, "name": "rating", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped category ID from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped state or province code from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "state", "type": "array"}, {"description": "Only BBB-accredited businesses", "in": "query", "name": "accredited", "type": "boolean"}, {"description": "Only businesses offering quote requests", "in": "query", "name": "get_quote", "type": "boolean"}, {"description": "Only businesses serving the searched area", "in": "query", "name": "service_area", "type": "boolean"}], "path": "/bbb/search", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "query", "required": true, "type": "string"}, {"in": "query", "name": "location", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}, {"enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "enum": ["A", "B", "C", "D", "F"], "in": "query", "name": "rating", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "state", "type": "array"}, {"in": "query", "name": "accredited", "type": "boolean"}, {"in": "query", "name": "get_quote", "type": "boolean"}, {"in": "query", "name": "service_area", "type": "boolean"}], "security": ["ApiKeyAuth"]}, "bbb-search-filters": {"bodyParam": null, "bodyRequired": false, "id": "bbb-search-filters", "method": "GET", "params": [{"description": "Business name or category/service keyword; use with location when category_url is omitted", "in": "query", "name": "query", "type": "string", "x-example": "plumber"}, {"description": "City and state/province or ZIP code; use with query when category_url is omitted", "in": "query", "name": "location", "type": "string", "x-example": "Austin, TX"}, {"description": "BBB category browse URL; use instead of query and location", "in": "query", "name": "category_url", "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/category/plumber"}, {"default": "USA", "description": "BBB country code", "enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"description": "Result page, default 1", "in": "query", "name": "page", "type": "integer"}, {"description": "Sort order", "enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"description": "Maximum distance in miles; omit for all distances", "enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "description": "Selected rating values", "in": "query", "items": {"enum": ["A", "B", "C", "D", "F"], "type": "string"}, "name": "rating", "type": "array"}, {"collectionFormat": "multi", "description": "Selected category IDs previously returned for this search context", "in": "query", "items": {"type": "string"}, "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "description": "Selected state/province codes previously returned for this search context", "in": "query", "items": {"type": "string"}, "name": "state", "type": "array"}, {"description": "Only BBB-accredited businesses", "in": "query", "name": "accredited", "type": "boolean"}, {"description": "Only businesses offering quote requests", "in": "query", "name": "get_quote", "type": "boolean"}, {"description": "Only businesses serving the searched area", "in": "query", "name": "service_area", "type": "boolean"}], "path": "/bbb/search/filters", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "query", "type": "string"}, {"in": "query", "name": "location", "type": "string"}, {"in": "query", "name": "category_url", "type": "string"}, {"enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"in": "query", "name": "page", "type": "integer"}, {"enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "enum": ["A", "B", "C", "D", "F"], "in": "query", "name": "rating", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "state", "type": "array"}, {"in": "query", "name": "accredited", "type": "boolean"}, {"in": "query", "name": "get_quote", "type": "boolean"}, {"in": "query", "name": "service_area", "type": "boolean"}], "security": ["ApiKeyAuth"]}}
|
|
22
|
+
{"bbb-article": {"bodyParam": null, "bodyRequired": false, "id": "bbb-article", "method": "GET", "params": [{"description": "Canonical BBB article URL", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/article/news-releases/34935-bbb-scam-alert-dont-be-fooled-by-free-gas-and-grocery-card-postcards"}], "path": "/bbb/article", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-business": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}], "path": "/bbb/business", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-business-complaints": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business-complaints", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url. A location URL ending in /addressId/<number> is accepted and read from the business profile", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}, {"default": 1, "description": "Complaint list page, 1 or greater (10 complaints per page, newest first). Defaults to 1", "in": "query", "minimum": 1, "name": "page", "type": "integer", "x-example": 1}], "path": "/bbb/business/complaints", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}], "security": ["ApiKeyAuth"]}, "bbb-business-more-info": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business-more-info", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url. A location URL ending in /addressId/<number> is accepted and read from the business profile", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}], "path": "/bbb/business/more-info", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-business-reviews": {"bodyParam": null, "bodyRequired": false, "id": "bbb-business-reviews", "method": "GET", "params": [{"description": "BBB business profile URL, from a bbb-search result's url or hq_profile_url. A location URL ending in /addressId/<number> is accepted and read from the business profile", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/profile/plumber/calixto-plumbing-0825-1000223803"}, {"description": "Result page (10 per page), default 1", "in": "query", "name": "page", "type": "integer"}], "path": "/bbb/business/reviews", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}], "security": ["ApiKeyAuth"]}, "bbb-category": {"bodyParam": null, "bodyRequired": false, "id": "bbb-category", "method": "GET", "params": [{"description": "BBB category browse URL, from a bbb-search result's related_categories", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/category/plumber"}, {"description": "Result page, default 1", "in": "query", "name": "page", "type": "integer"}, {"description": "Sort order", "enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"description": "Maximum distance in miles; omit for all distances", "enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "description": "One or more BBB rating buckets", "in": "query", "items": {"enum": ["A", "B", "C", "D", "F"], "type": "string"}, "name": "rating", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped category ID from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped state or province code from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "state", "type": "array"}, {"description": "Only BBB-accredited businesses", "in": "query", "name": "accredited", "type": "boolean"}, {"description": "Only businesses offering quote requests", "in": "query", "name": "get_quote", "type": "boolean"}, {"description": "Only businesses serving the searched area", "in": "query", "name": "service_area", "type": "boolean"}], "path": "/bbb/category", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}, {"enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "enum": ["A", "B", "C", "D", "F"], "in": "query", "name": "rating", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "state", "type": "array"}, {"in": "query", "name": "accredited", "type": "boolean"}, {"in": "query", "name": "get_quote", "type": "boolean"}, {"in": "query", "name": "service_area", "type": "boolean"}], "security": ["ApiKeyAuth"]}, "bbb-local-bbb": {"bodyParam": null, "bodyRequired": false, "id": "bbb-local-bbb", "method": "GET", "params": [{"description": "Canonical BBB chapter URL from bbb-local-bbbs or a business record's local_bbb_url", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/local-bbb/bbb-serving-the-heart-of-texas"}], "path": "/bbb/local-bbb", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-local-bbbs": {"bodyParam": null, "bodyRequired": false, "id": "bbb-local-bbbs", "method": "GET", "params": [{"description": "Country code from bbb-regions", "enum": ["us", "ca"], "in": "query", "name": "country", "required": true, "type": "string", "x-example": "us"}, {"description": "Two-letter region code from bbb-regions", "in": "query", "name": "region", "required": true, "type": "string", "x-example": "tx"}], "path": "/bbb/local-bbbs", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["us", "ca"], "in": "query", "name": "country", "required": true, "type": "string"}, {"in": "query", "name": "region", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-news": {"bodyParam": null, "bodyRequired": false, "id": "bbb-news", "method": "GET", "params": [{"description": "Canonical https://www.bbb.org newsroom URL: /us/news or /ca/news; /<country>/<state>/news or /<country>/<state>/<city>/news with country us or ca, the two-letter region code from bbb-regions and the city slug from a business profile URL; or a chapter's news_url from bbb-local-bbbs. Append a topic segment from bbb-news-topics to narrow it and ?page=N (1 to 1000) to page; no other query key is accepted", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/news/scams?page=2"}], "path": "/bbb/news", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-news-topics": {"bodyParam": null, "bodyRequired": false, "id": "bbb-news-topics", "method": "GET", "params": [{"description": "Canonical https://www.bbb.org newsroom URL, optionally with a topic segment: /us/news or /ca/news; /<country>/<state>/news or /<country>/<state>/<city>/news with country us or ca, the two-letter region code from bbb-regions and the city slug from a business profile URL; or a chapter's news_url from bbb-local-bbbs", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/us/news"}], "path": "/bbb/news/topics", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-page": {"bodyParam": null, "bodyRequired": false, "id": "bbb-page", "method": "GET", "params": [{"description": "Canonical https://www.bbb.org URL of an evergreen page (/all/<path>, no query string) or of an article (/article/<type>/<id>-<slug>) that BBB has moved to one", "in": "query", "name": "url", "required": true, "type": "string", "x-example": "https://www.bbb.org/all/consumer/tip/what-to-know-before-purchasing-a-gift-card"}], "path": "/bbb/page", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "url", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-regions": {"bodyParam": null, "bodyRequired": false, "id": "bbb-regions", "method": "GET", "params": [], "path": "/bbb/regions", "pathParams": [], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "bbb-scamtracker-detail": {"bodyParam": null, "bodyRequired": false, "id": "bbb-scamtracker-detail", "method": "GET", "params": [{"description": "BBB Scam Tracker report id, from a bbb-scamtracker-search result's id or url", "in": "path", "name": "id", "required": true, "type": "string", "x-example": "1397968"}], "path": "/bbb/scamtracker/{id}", "pathParams": ["id"], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "bbb-scamtracker-search": {"bodyParam": null, "bodyRequired": false, "id": "bbb-scamtracker-search", "method": "GET", "params": [{"description": "Free-text search (phone number, website, email, business name, scam ID, description). Omit to browse the most-recent feed", "in": "query", "name": "query", "type": "string", "x-example": "amazon"}, {"description": "Scam category filter", "enum": ["Advance Fee Loan", "Bank/Credit Card Company Imposter", "Business Email Compromise", "Charity", "Counterfeit Product", "COVID-19", "Credit Cards", "Credit Repair/Debt Relief", "CryptoCurrency", "Debt Collections", "Employment", "Fake Check/Money Order", "Fake Invoice/Supplier Bill", "Family/Friend Emergency", "Foreign Money Exchange", "Government Agency Imposter", "Government Grant", "Healthcare/Medicaid/Medicare", "Home Improvement", "Identity Theft", "Investment", "Moving", "Online Purchase", "Other", "Phishing", "Rental", "Retail Business", "Romance", "Scholarship", "Sweepstakes/Lottery/Prizes", "Tax Collection", "Tech Support", "Travel/Vacation/Timeshare", "Utility", "Vanity Award", "Worthless Problem-solving Service", "Yellow Pages/Directories"], "in": "query", "name": "scam_type", "type": "string"}, {"description": "Optional 2-letter targeted-victim state/province code (US state or Canadian province)", "in": "query", "name": "state", "type": "string", "x-example": "TX"}, {"description": "Optional 2-letter reported-scammer state/province code (US state or Canadian province) -- where the scammer is reported to be, not the victim", "in": "query", "name": "scammer_state", "type": "string", "x-example": "NY"}, {"description": "Optional report-date range start (YYYY-MM-DD), inclusive. Must be set together with date_to", "in": "query", "name": "date_from", "type": "string", "x-example": "2026-01-01"}, {"description": "Optional report-date range end (YYYY-MM-DD), inclusive. Must be set together with date_from", "in": "query", "name": "date_to", "type": "string", "x-example": "2026-01-31"}, {"description": "Optional minimum reported dollar loss. Must be set together with max_dollars_lost", "in": "query", "name": "min_dollars_lost", "type": "integer", "x-example": 500000}, {"description": "Optional maximum reported dollar loss. Must be set together with min_dollars_lost", "in": "query", "name": "max_dollars_lost", "type": "integer", "x-example": 1000000}, {"description": "Result page (10 per page), default 1", "in": "query", "name": "page", "type": "integer"}], "path": "/bbb/scamtracker/search", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "query", "type": "string"}, {"enum": ["Advance Fee Loan", "Bank/Credit Card Company Imposter", "Business Email Compromise", "Charity", "Counterfeit Product", "COVID-19", "Credit Cards", "Credit Repair/Debt Relief", "CryptoCurrency", "Debt Collections", "Employment", "Fake Check/Money Order", "Fake Invoice/Supplier Bill", "Family/Friend Emergency", "Foreign Money Exchange", "Government Agency Imposter", "Government Grant", "Healthcare/Medicaid/Medicare", "Home Improvement", "Identity Theft", "Investment", "Moving", "Online Purchase", "Other", "Phishing", "Rental", "Retail Business", "Romance", "Scholarship", "Sweepstakes/Lottery/Prizes", "Tax Collection", "Tech Support", "Travel/Vacation/Timeshare", "Utility", "Vanity Award", "Worthless Problem-solving Service", "Yellow Pages/Directories"], "in": "query", "name": "scam_type", "type": "string"}, {"in": "query", "name": "state", "type": "string"}, {"in": "query", "name": "scammer_state", "type": "string"}, {"in": "query", "name": "date_from", "type": "string"}, {"in": "query", "name": "date_to", "type": "string"}, {"in": "query", "name": "min_dollars_lost", "type": "integer"}, {"in": "query", "name": "max_dollars_lost", "type": "integer"}, {"in": "query", "name": "page", "type": "integer"}], "security": ["ApiKeyAuth"]}, "bbb-scamtracker-state-stats": {"bodyParam": null, "bodyRequired": false, "id": "bbb-scamtracker-state-stats", "method": "GET", "params": [{"description": "Aggregation window, default 90", "enum": ["30", "90", "365", "all"], "in": "query", "name": "period", "type": "string"}], "path": "/bbb/scamtracker/state-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["30", "90", "365", "all"], "in": "query", "name": "period", "type": "string"}], "security": ["ApiKeyAuth"]}, "bbb-search": {"bodyParam": null, "bodyRequired": false, "id": "bbb-search", "method": "GET", "params": [{"description": "Business name or category/service keyword", "in": "query", "name": "query", "required": true, "type": "string", "x-example": "plumber"}, {"description": "City and state (e.g. 'Austin, TX') or a ZIP code", "in": "query", "name": "location", "required": true, "type": "string", "x-example": "Austin, TX"}, {"description": "Result page, default 1", "in": "query", "name": "page", "type": "integer"}, {"default": "USA", "description": "BBB country code", "enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"description": "Sort order", "enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"description": "Maximum distance in miles; omit for all distances", "enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "description": "One or more BBB rating buckets", "in": "query", "items": {"enum": ["A", "B", "C", "D", "F"], "type": "string"}, "name": "rating", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped category ID from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "description": "Query-scoped state or province code from bbb-search-filters", "in": "query", "items": {"type": "string"}, "name": "state", "type": "array"}, {"description": "Only BBB-accredited businesses", "in": "query", "name": "accredited", "type": "boolean"}, {"description": "Only businesses offering quote requests", "in": "query", "name": "get_quote", "type": "boolean"}, {"description": "Only businesses serving the searched area", "in": "query", "name": "service_area", "type": "boolean"}], "path": "/bbb/search", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "query", "required": true, "type": "string"}, {"in": "query", "name": "location", "required": true, "type": "string"}, {"in": "query", "name": "page", "type": "integer"}, {"enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "enum": ["A", "B", "C", "D", "F"], "in": "query", "name": "rating", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "state", "type": "array"}, {"in": "query", "name": "accredited", "type": "boolean"}, {"in": "query", "name": "get_quote", "type": "boolean"}, {"in": "query", "name": "service_area", "type": "boolean"}], "security": ["ApiKeyAuth"]}, "bbb-search-filters": {"bodyParam": null, "bodyRequired": false, "id": "bbb-search-filters", "method": "GET", "params": [{"description": "Business name or category/service keyword; use with location when category_url is omitted", "in": "query", "name": "query", "type": "string", "x-example": "plumber"}, {"description": "City and state/province or ZIP code; use with query when category_url is omitted", "in": "query", "name": "location", "type": "string", "x-example": "Austin, TX"}, {"description": "BBB category browse URL; use instead of query and location", "in": "query", "name": "category_url", "type": "string", "x-example": "https://www.bbb.org/us/tx/austin/category/plumber"}, {"default": "USA", "description": "BBB country code", "enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"description": "Result page, default 1", "in": "query", "name": "page", "type": "integer"}, {"description": "Sort order", "enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"description": "Maximum distance in miles; omit for all distances", "enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "description": "Selected rating values", "in": "query", "items": {"enum": ["A", "B", "C", "D", "F"], "type": "string"}, "name": "rating", "type": "array"}, {"collectionFormat": "multi", "description": "Selected category IDs previously returned for this search context", "in": "query", "items": {"type": "string"}, "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "description": "Selected state/province codes previously returned for this search context", "in": "query", "items": {"type": "string"}, "name": "state", "type": "array"}, {"description": "Only BBB-accredited businesses", "in": "query", "name": "accredited", "type": "boolean"}, {"description": "Only businesses offering quote requests", "in": "query", "name": "get_quote", "type": "boolean"}, {"description": "Only businesses serving the searched area", "in": "query", "name": "service_area", "type": "boolean"}], "path": "/bbb/search/filters", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "query", "type": "string"}, {"in": "query", "name": "location", "type": "string"}, {"in": "query", "name": "category_url", "type": "string"}, {"enum": ["USA", "CAN"], "in": "query", "name": "country", "type": "string"}, {"in": "query", "name": "page", "type": "integer"}, {"enum": ["Relevance", "Distance", "Rating", "AToZ", "ZToA"], "in": "query", "name": "sort", "type": "string"}, {"enum": ["5", "10", "25", "50", "100"], "in": "query", "name": "distance", "type": "string"}, {"collectionFormat": "multi", "enum": ["A", "B", "C", "D", "F"], "in": "query", "name": "rating", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "category_id", "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "state", "type": "array"}, {"in": "query", "name": "accredited", "type": "boolean"}, {"in": "query", "name": "get_quote", "type": "boolean"}, {"in": "query", "name": "service_area", "type": "boolean"}], "security": ["ApiKeyAuth"]}}
|
|
23
23
|
JSON
|
|
24
24
|
OPERATION_IDS = JSON.parse(<<~'JSON').freeze
|
|
25
|
-
["bbb-article", "bbb-business", "bbb-business-complaints", "bbb-business-more-info", "bbb-business-reviews", "bbb-category", "bbb-local-bbb", "bbb-local-bbbs", "bbb-news", "bbb-news-topics", "bbb-regions", "bbb-scamtracker-detail", "bbb-scamtracker-search", "bbb-scamtracker-state-stats", "bbb-search", "bbb-search-filters"]
|
|
25
|
+
["bbb-article", "bbb-business", "bbb-business-complaints", "bbb-business-more-info", "bbb-business-reviews", "bbb-category", "bbb-local-bbb", "bbb-local-bbbs", "bbb-news", "bbb-news-topics", "bbb-page", "bbb-regions", "bbb-scamtracker-detail", "bbb-scamtracker-search", "bbb-scamtracker-state-stats", "bbb-search", "bbb-search-filters"]
|
|
26
26
|
JSON
|
|
27
27
|
OPERATION_COUNT = OPERATION_IDS.length
|
|
28
28
|
|
|
29
29
|
class Client
|
|
30
30
|
attr_reader :base_url
|
|
31
31
|
|
|
32
|
-
def initialize(api_key: ENV["CRAWLORA_API_KEY"], base_url: "https://api.crawlora.net/api/v1", timeout: 30, user_agent: "crawlora-bbb-ruby/0.
|
|
32
|
+
def initialize(api_key: ENV["CRAWLORA_API_KEY"], base_url: "https://api.crawlora.net/api/v1", timeout: 30, user_agent: "crawlora-bbb-ruby/0.5.0", transport: nil)
|
|
33
33
|
@api_key = api_key
|
|
34
34
|
@base_url = base_url.to_s.sub(%r{/+$}, "")
|
|
35
35
|
@timeout = Float(timeout)
|
|
@@ -154,6 +154,10 @@ module Crawlora
|
|
|
154
154
|
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
155
155
|
request('bbb-news-topics', params, response_type: response_type)
|
|
156
156
|
end
|
|
157
|
+
define_method('page') do |**params|
|
|
158
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
159
|
+
request('bbb-page', params, response_type: response_type)
|
|
160
|
+
end
|
|
157
161
|
define_method('regions') do |**params|
|
|
158
162
|
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
159
163
|
request('bbb-regions', params, response_type: response_type)
|
data/lib/crawlora/bbb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crawlora-bbb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Crawlora
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Ruby client for Crawlora's hosted Better Business Bureau API. Covers
|
|
14
14
|
business search, profiles, complaints, reviews, categories, and ScamTracker reports
|
|
15
|
-
across
|
|
15
|
+
across 17 endpoints.
|
|
16
16
|
email:
|
|
17
17
|
executables: []
|
|
18
18
|
extensions: []
|
|
@@ -49,5 +49,5 @@ requirements: []
|
|
|
49
49
|
rubygems_version: 3.4.19
|
|
50
50
|
signing_key:
|
|
51
51
|
specification_version: 4
|
|
52
|
-
summary: Better Business Bureau API client for Crawlora (
|
|
52
|
+
summary: Better Business Bureau API client for Crawlora (17 endpoints)
|
|
53
53
|
test_files: []
|