apollo-lusha-credit-quote 1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d520937698cd20c5f9ca66e3b755e0ba6ce54e6eca117afbffc9c9ec934e75cd
4
+ data.tar.gz: c600306f9208add9b89adaed4a4875747f980f74a8bcca079d401efbd037e702
5
+ SHA512:
6
+ metadata.gz: 6fbb06e869e2f53aa0d61f70e2327fae9c9e6532ac41ed5a76bca0dda16067794070c4e6e04d7cbfbaf9c335e82d72f1a633fec988fd0df8f5a83ae5daa7ff60
7
+ data.tar.gz: e59ddf93d3db3d72c5a6fbc34989bb97479d8f2c6e7d855c96365679bc2c3b403053cf4e01b505c9a1d8e64894c5062e010f8066b7cf4f1c0455c79fff8f137b
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OneGTMLab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # apollo-lusha-credit-quote
2
+
3
+ A Ruby command-line tool for the comparison
4
+ [Apollo vs Lusha](https://www.onegtmlab.dev/tool-directory/compare/apollo-vs-lusha) in the OneGTMLab tool directory.
5
+ Give it a number of people and how many of them you want a phone for. It prints what each vendor charges in credits, which plan and how many seats cover the job, what that costs, and how many API calls and how much time it takes at each plan's published limits.
6
+ The page was verified on 25 Oct 2026 and read again on 28 Nov 2026; where it is silent the tool prints "not stated".
7
+
8
+ What the page says, and what the tool does with it:
9
+
10
+ - **Credits:** Apollo charges 1 credit for a matched person's email and data, plus 8 when a mobile is returned (9 in total for a person with a phone). Lusha charges 1 credit per email and 5 per phone. A search that finds nothing is not charged on Apollo; Lusha's billing FAQ says NOT_FOUND is not charged, although one Lusha docs page differs. The `--found` option applies that.
11
+ - **Plans:** Apollo is per seat with credits pooled across the team, no rollover: Free 75 credits a seat a month, Basic $65 monthly or $49 annual (2,500 a month, or 30,000 a year upfront), Professional $99 or $79 (4,000 a month, 48,000 a year), Organization $119 annual only, minimum 3 seats, 72,000 a year. Lusha is per plan with seats included: Free 40 credits a month, Starter $49.90 or $37.45 (400 a month, 4,800 a year), Pro $69.90 or $52.45 (600 a month, 7,200 a year), Premium $399.90 or $299.95 (3,400 a month at the slider default). Scale is a custom quote and is not in the tables. For Apollo the tool counts seats; for Lusha the page does not say whether a second plan can be bought, so a plan that is too small is reported as short, never multiplied.
12
+ - **API calls:** Apollo bulk enrichment takes up to 10 records per call, Lusha 1 to 100. Apollo allows 1,000 enrichment calls a minute on paid plans (Free: 50 a minute, 600 a day). Lusha publishes 40 a minute and 100 a day on Free and Starter, 50 a minute and 1,500 a day on Pro, 300 a minute on Premium. Daily figures the page does not give print as "not stated".
13
+
14
+ ```bash
15
+ ruby bin/apollo-lusha-credit-quote --people 2000 --phones 300 --found 0.85
16
+ ruby bin/apollo-lusha-credit-quote --people 12000 --phones 1500 --billing monthly --months 3
17
+ ruby bin/apollo-lusha-credit-quote --people 500 --json
18
+ ```
19
+
20
+ Prices change; re-read the page before you rely on a figure. Ruby 3 or later, standard library only.
21
+
22
+ ## Install
23
+
24
+ ```bash
25
+ gem install apollo-lusha-credit-quote
26
+ ```
27
+
28
+ ## Test
29
+
30
+ ```bash
31
+ ruby test/quote_test.rb
32
+ ```
33
+
34
+ The people counts and rates in `examples/` are made up for illustration. MIT licensed.
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "optparse"
5
+ require "json"
6
+ require_relative "../lib/apollo_lusha_quote"
7
+
8
+ o = { phones: 0, found: 1.0, months: 1, billing: :annual }
9
+ OptionParser.new do |op|
10
+ op.banner = "usage: apollo-lusha-credit-quote --people N [--phones N] [--found 0.8] [--months N] [--billing annual|monthly] [--json]"
11
+ op.on("--people N", Integer, "people to enrich") { |v| o[:people] = v }
12
+ op.on("--phones N", Integer, "how many of them you also want a phone for") { |v| o[:phones] = v }
13
+ op.on("--found R", Float, "share of people the vendor finds (a miss is not charged), default 1.0") { |v| o[:found] = v }
14
+ op.on("--months N", Integer, "months the job is spread over, default 1") { |v| o[:months] = v }
15
+ op.on("--billing B", %w[annual monthly]) { |v| o[:billing] = v.to_sym }
16
+ op.on("--json") { o[:json] = true }
17
+ end.parse!
18
+
19
+ abort "need --people N" unless o[:people]
20
+ begin
21
+ q = ApolloLushaQuote.quote(ApolloLushaQuote::Job.new(**o.slice(:people, :phones, :found, :months, :billing)))
22
+ rescue ArgumentError => e
23
+ abort "error: #{e.message}"
24
+ end
25
+ puts o[:json] ? JSON.pretty_generate(q) : ApolloLushaQuote.render(q)
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Credit and plan arithmetic for the OneGTMLab comparison "Apollo vs Lusha".
4
+ # Every figure below is what that page states (verified 25 Oct 2026, read again 28 Nov 2026).
5
+ # Where the page is silent the value is nil and the report prints "not stated".
6
+ module ApolloLushaQuote
7
+ SOURCE = "https://www.onegtmlab.dev/tool-directory/compare/apollo-vs-lusha"
8
+ READ = "page verified 25 Oct 2026, read 28 Nov 2026"
9
+
10
+ # Credits per record
11
+ APOLLO_PERSON = 1 # matched person's email and data
12
+ APOLLO_MOBILE = 8 # added when a mobile number is returned
13
+ LUSHA_EMAIL = 1
14
+ LUSHA_PHONE = 5
15
+ APOLLO_BULK = 10 # records per bulk call
16
+ LUSHA_BULK = 100 # records per call
17
+
18
+ # monthly/annual: price per seat (Apollo) or per plan (Lusha) per month.
19
+ # credits_month / credits_year: allowance per seat (Apollo) or per plan (Lusha).
20
+ # per_min / per_day: API calls allowed; nil = the page gives no figure.
21
+ APOLLO = {
22
+ "Apollo Free" => { monthly: 0, annual: 0, credits_month: 75, credits_year: 900, per_min: 50, per_day: 600, min_seats: 1 },
23
+ "Apollo Basic" => { monthly: 65, annual: 49, credits_month: 2_500, credits_year: 30_000, per_min: 1_000, per_day: nil, min_seats: 1 },
24
+ "Apollo Professional" => { monthly: 99, annual: 79, credits_month: 4_000, credits_year: 48_000, per_min: 1_000, per_day: nil, min_seats: 1 },
25
+ # Organization: annual billing only, minimum 3 seats; the page gives no monthly credit figure
26
+ "Apollo Organization" => { monthly: nil, annual: 119, credits_month: nil, credits_year: 72_000, per_min: 1_000, per_day: nil, min_seats: 3 }
27
+ }.freeze
28
+
29
+ LUSHA = {
30
+ "Lusha Free" => { monthly: 0, annual: nil, credits_month: 40, credits_year: nil, per_min: 40, per_day: 100, seats: 1 },
31
+ "Lusha Starter" => { monthly: 49.90, annual: 37.45, annual_total: 449.10, credits_month: 400, credits_year: 4_800, per_min: 40, per_day: 100, seats: 1 },
32
+ "Lusha Pro" => { monthly: 69.90, annual: 52.45, annual_total: 629.10, credits_month: 600, credits_year: 7_200, per_min: 50, per_day: 1_500, seats: 2 },
33
+ # Premium: credits at the slider's default position; the slider changes the price
34
+ "Lusha Premium" => { monthly: 399.90, annual: 299.95, annual_total: 3_599.10, credits_month: 3_400, credits_year: 40_800, per_min: 300, per_day: nil, seats: 5 }
35
+ }.freeze
36
+
37
+ Job = Struct.new(:people, :phones, :found, :months, :billing, keyword_init: true)
38
+
39
+ module_function
40
+
41
+ def validate!(job)
42
+ raise ArgumentError, "people must be a positive integer" unless job.people.is_a?(Integer) && job.people.positive?
43
+ raise ArgumentError, "phones must be between 0 and people" unless job.phones.between?(0, job.people)
44
+ raise ArgumentError, "found rate must be between 0 and 1" unless job.found.between?(0, 1)
45
+ raise ArgumentError, "months must be positive" unless job.months.positive?
46
+ raise ArgumentError, "billing must be annual or monthly" unless %i[annual monthly].include?(job.billing)
47
+ job
48
+ end
49
+
50
+ # Records that are billed: a miss costs 0 credits on Apollo; on Lusha NOT_FOUND is not charged
51
+ # per the billing FAQ (the page notes one docs page disagrees).
52
+ def found_records(job) = (job.people * job.found).round
53
+
54
+ def phones_billed(job) = [(job.phones * job.found).round, found_records(job)].min
55
+
56
+ def apollo_credits(job) = found_records(job) * APOLLO_PERSON + phones_billed(job) * APOLLO_MOBILE
57
+
58
+ def lusha_credits(job) = found_records(job) * LUSHA_EMAIL + phones_billed(job) * LUSHA_PHONE
59
+
60
+ def ceil_div(a, b) = (a + b - 1) / b
61
+
62
+ # Seats of one Apollo plan needed. Monthly billing: the allowance is per month, unused credits do not
63
+ # roll over, so the spend is spread evenly over the months. Annual: the year's credits are granted upfront.
64
+ def apollo_plan(name, spec, job)
65
+ credits = apollo_credits(job)
66
+ price = spec[job.billing]
67
+ allowance = job.billing == :annual ? spec[:credits_year] : spec[:credits_month]
68
+ return { plan: name, status: "not stated for #{job.billing} billing" } if price.nil? || allowance.nil?
69
+
70
+ need = job.billing == :annual ? credits : ceil_div(credits, job.months)
71
+ seats = [ceil_div(need, allowance), spec[:min_seats]].max
72
+ months_paid = job.billing == :annual ? 12 : job.months
73
+ cost = (seats * price * months_paid).round(2)
74
+ { plan: name, seats: seats, credits_needed: credits, allowance_per_seat: allowance,
75
+ months_paid: months_paid, cost: cost, status: "ok" }
76
+ end
77
+
78
+ # Lusha plans carry seats; the page does not say whether you can buy more than one plan,
79
+ # so a plan that is too small is reported as short, never multiplied.
80
+ def lusha_plan(name, spec, job)
81
+ credits = lusha_credits(job)
82
+ price = spec[job.billing]
83
+ allowance = job.billing == :annual ? spec[:credits_year] : spec[:credits_month]
84
+ return { plan: name, status: "not stated for #{job.billing} billing" } if price.nil? || allowance.nil?
85
+
86
+ need = job.billing == :annual ? credits : ceil_div(credits, job.months)
87
+ months_paid = job.billing == :annual ? 12 : job.months
88
+ # the page prints the yearly total for annual billing ($449.10 on Starter), so use it as stated
89
+ cost = job.billing == :annual && spec[:annual_total] ? spec[:annual_total] : (price * months_paid).round(2)
90
+ short = [need - allowance, 0].max
91
+ { plan: name, seats: spec[:seats], credits_needed: credits, allowance_per_seat: allowance,
92
+ months_paid: months_paid, cost: cost, short: short,
93
+ status: short.zero? ? "ok" : "short by #{short} credits (page does not say whether a second plan can be bought)" }
94
+ end
95
+
96
+ def api_calls(job)
97
+ n = found_records(job)
98
+ { apollo: ceil_div(job.people, APOLLO_BULK), lusha: ceil_div(job.people, LUSHA_BULK), records: n }
99
+ end
100
+
101
+ # Minutes and days to push the calls through a plan's published API allowance.
102
+ def call_time(calls, spec)
103
+ minutes = spec[:per_min] ? ceil_div(calls, spec[:per_min]) : nil
104
+ days = spec[:per_day] ? ceil_div(calls, spec[:per_day]) : nil
105
+ { minutes: minutes, days: days }
106
+ end
107
+
108
+ def quote(job)
109
+ validate!(job)
110
+ calls = api_calls(job)
111
+ {
112
+ source: SOURCE, read: READ,
113
+ apollo_credits: apollo_credits(job), lusha_credits: lusha_credits(job),
114
+ apollo_calls: calls[:apollo], lusha_calls: calls[:lusha],
115
+ apollo_plans: APOLLO.map { |n, s| apollo_plan(n, s, job).merge(call_time(calls[:apollo], s)) },
116
+ lusha_plans: LUSHA.map { |n, s| lusha_plan(n, s, job).merge(call_time(calls[:lusha], s)) }
117
+ }
118
+ end
119
+
120
+ def money(v) = v.nil? ? "not stated" : format("$%.2f", v)
121
+
122
+ def fmt(v) = v.nil? ? "not stated" : v.to_s
123
+
124
+ def render(q)
125
+ out = ["Source: #{q[:source]} (#{q[:read]})", ""]
126
+ out << "Credits: Apollo #{q[:apollo_credits]} (1 per matched person + 8 per mobile), Lusha #{q[:lusha_credits]} (1 per email + 5 per phone)"
127
+ out << "API calls: Apollo #{q[:apollo_calls]} (10 per call), Lusha #{q[:lusha_calls]} (up to 100 per call)"
128
+ out << ""
129
+ (q[:apollo_plans] + q[:lusha_plans]).each do |p|
130
+ if p[:cost].nil?
131
+ out << format("%-20s %s", p[:plan], p[:status])
132
+ else
133
+ out << format("%-20s %2d seat(s) %12s for %2d month(s) %-6s minutes %-10s days %-10s",
134
+ p[:plan], p[:seats], money(p[:cost]), p[:months_paid], p[:status] == "ok" ? "fits" : "short",
135
+ fmt(p[:minutes]), fmt(p[:days]))
136
+ out << " #{p[:status]}" unless p[:status] == "ok"
137
+ end
138
+ end
139
+ out.join("\n")
140
+ end
141
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: apollo-lusha-credit-quote
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jainendra Ojha
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: "Give it a number of people and how many phones you want. It prints the credits each vendor charges (Apollo 1 per person plus 8 per mobile, Lusha 1 per email plus 5 per phone), the seats and cost per plan, and the API calls and time at each plan's published limits. Figures come from the OneGTMLab Apollo vs Lusha page; where it is silent the tool prints not stated."
13
+ email:
14
+ - account@onegtmlab.dev
15
+ executables:
16
+ - apollo-lusha-credit-quote
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - bin/apollo-lusha-credit-quote
23
+ - lib/apollo_lusha_quote.rb
24
+ homepage: "https://www.onegtmlab.dev/tool-directory/compare/apollo-vs-lusha"
25
+ licenses:
26
+ - MIT
27
+ metadata:
28
+ source_code_uri: "https://github.com/jaizendra-netizen/apollo-lusha-credit-quote"
29
+ homepage_uri: "https://www.onegtmlab.dev/tool-directory/compare/apollo-vs-lusha"
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ -
36
+ - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: "2.7"
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ -
42
+ - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ requirements: []
46
+ rubygems_version: 4.1.0
47
+ specification_version: 4
48
+ summary: "Ruby CLI: credits, seats, plan cost and API calls to enrich a list on Apollo or Lusha, from the published rules on the OneGTMLab comparison page."
49
+ test_files: []