# I Cloned a $1B B2B SaaS With Claude Code (1 cent per lead / beginner friendly / full guide) Channel: Olly Rosewell Video: https://www.youtube.com/watch?v=tlqW6vSw3b8 Duration: 30 min Language: English Words: 5802 Transcript page: https://viewrankai.com/tools/youtube-transcript/tlqW6vSw3b8 --- [0:00] What's going on guys? This is Oliver from rosewell.dev where I teach people how to build their own software and rosewell.dev/build where I actually build people's products for them. So in this video I'm going to be using Treg to create a full-scale waterfall enrichment tool called Cascade. Now let's explain what that means, right? So in B2B SaaS specifically when you're trying to sell to businesses, you need data and data's very expensive. So you might need someone's email to give them a cold email. You might need someone's mobile data to give them a cold call or give them a warm call, whatever it may be. And this is expensive and specifically waterfall [0:41] enrichment is where you might be looking for a plumbers in the UK, right? So let's say we're targeting plumbers cuz we have a an AI tool that helps plumbers. If I say I want to contact plumbers who are solo and have, you know, sort of 1 million in revenue or let's say they have five employees and 1 million revenue from the UK. And we want the mobiles and the emails of those plumbers. We can either just try and find them online which is very difficult or we can use enrichment tools to give the, you know, the the criteria. We want plumbers of that size and of that [1:16] revenue and then tools will find that data for us. What Treg does, Treg is a a one-stop shop API with thousands of different tools and we're going to be using Treg's list of company enrichment tools today. We ask for a specific list of leads and then what Treg does is it calls upon dozens of providers in a waterfall style as you can see to find [1:42] data. This is extremely expensive at scale if you don't use Treg. The reason being there's dozens of multi-multi-million and billion-dollar tools that do this and we're going to be cloning that today with one API key using Treg's suite of tools. Now, Treg has over 3,000, almost 4,000 tools for agents, right? Obviously, it has SEO and AEO tools that you can call from one dashboard or or from your, you know, terminal. It's got social, it's got advertising, e-com, reviews and apps. But, the ones that we're going to be using is company data and people and contact data. So, an example here is that we can find people [2:19] by role, find people's work emails, verify those emails, count a people search before paying, so we can check how many people are, you know, inside of our sort of like target market, find people's mobile numbers, enrich people's profiles. And as you can see, this entire process is going to be done where we ask for that data, and it's going to go through this extremely long um waterfall to enrich that data and give us what we need. Now, to get started on this build, all you really have to do is copy um the llms.txt and put it into Claude code or whatever it may be, [2:51] wherever you are effectively coding. Obviously, you can go code index, Claude AI, Grok Bot, whatever it may be. We're using Claude code, so we're just going to copy this. And the other thing we can do as well is because we can use thousands of tools from Treg for enriching the data and finding data online, but we only have to have one API key instead of signing up for 3,000 tools. There's just an API key here that you are going to copy and then paste into Claude code. What I'll do, guys, is all of this will be in the description, the PRD, the entire full instructional, um and we'll get into the build right [3:23] now and go from there. If you guys have any questions, just let me know. Um but, let's clone a $1 SaaS app that allows people to find company contact data at scale um and allow you to build this yourself so that you can charge customers for it. So, the first thing we've done is actually post this entire PRD inside of Claude code, right? So, the most important part is that inside of Treg, you get instructions on installing um the direct connection between Treg and Claude code. Um to set up Treg, we post in the treg.to llms.txt, and then of course, there's my API key, [laughter] so obviously going to [4:03] I'm obviously going to change that before the video actually goes live, right? And you guys should not share your API keys on a on a live YouTube video. So, effectively going through all this is the entire PRD that I've put in the description as well. Um so, you'll be able to actually um sort of, you know, just copy-paste this and start the same project. Um and on top of that, what we're doing is we're working out of our folder, which is Treg waterfall. So, I'm going to skip ahead to when that first initial code is done, uh cuz it's currently running, and we'll go from there. The next and most [4:35] important thing is that within this, um obviously the actual process of uploading um information about your business, and then it finding leads for you through Treg, is that um we need Claude um the, you know, API from Claude, say Haiku or Sonnet or Opus, we need that to make some decisions about what kind of leads we're going to find. Because if you say that you're a marketing agency that goes after um plumbers in the UK, right? Treg is obviously going to have to work in a specific manner with with a specific string of queries to find plumbers for [5:10] you for you to do outreach, right? So, what it has asked for is in phase one, the first thing that it noticed is that we didn't have an Anthropic API key set. So, to build on the ICP and find the right leads through Treg, I've made sure to give um Claude code my API key, which is by here. So, we are now at checkpoint one, which is in plain words, Treg is one power socket that fits hundreds of data companies. Instead of signing up to Tomba, Kit ICPs, etc., and the rest one by one, we plug in Treg once and get one key and one bill. So, where Treg fits, [5:47] so far we've installed the Treg CLI. We have um added all of the PRD endpoints looked up in the catalog. All exist and all of the prices match. So, now we have that direct connection. The exact inputs read um and they've been read for each each one. So, for example, if we're asking one of their providers for data and another one, we need to make sure that all of those get the right data. So, for example, K 2 wants a name and domain, whereas AI Arc wants a LinkedIn URL um etc. etc., right? So, where Treg fits, for now it's the phone book that Claude uses to look [6:22] up each provider's price, inputs, and hit rate before we write the code. So, the next checkpoint was the foundation. We've set up the Next JS app on localhost. We have a local database with around 15 tables and all of the price lists loaded. A design system, a watercolor kit for the you know, for the landing page and the actual dashboard to look pretty. And then a sidebar, a top bar with a credits meter, a credit card um you know, input field, and an empty state on every page. So, currently Treg calls um that table is ready. So, every call's real cost gets recorded to the cent. And that means then that if you [7:01] guys are building this for clients at scale, you'll notice if someone signs up and says I want 1,000 companies, you know exactly how much that's going to cost with Treg. Because if you start saying look, we'll give you 1,000 credits a month and it's costing you $50 to get it and you're charging them $29 a month, then you are in big trouble because you are not um you are not adhering to the rules of API-based businesses, which is that you there [7:26] needs to be a margin for you in there. So, just keep that in mind when you're using a tool like Treg because you can get all the data you've ever wanted in your life from Treg. But you've got to make sure that if you're building this as a you know, if you're wrapping Treg inside a product of your own, you've got to make sure that you keep in mind the costs. Treg is very, very cost-effective. It's very affordable, and you won't get prices like it elsewhere, but the point is at 10,000 calls, it's still going to cost you some money. So, you need to make sure that [7:54] that margin is there for you to charge your own clients. The next thing Treg is actually doing is building the plumbing. So, Claude Code, sorry, and Treg are building the plumbing for us. So, we we've made some free Treg calls to learn response shapes. So, some free counts confirm that ICPs found 9,000 matching US and UK accounting firms for this example, you know, ICP that we're building, which is, you know, a SaaS that helps with accounting, right? So, I'll fix what it's asked is said that it'll fix company in which is ignored filters by checking schema. So, all this is doing right now, guys, is Claude Code is [8:34] talking with Treg about how we can get data. Because if we ask for data the same way from one provider that Treg offers to another, we're going to get loads of random data. So, that's the important part of setting up the connection between Treg and Claude Code, because Claude Code is just going to really get to know Treg in a way that means that every call you make enriches the right data and gets you what you want if you're wrapping this. Remember that you have hundreds of different providers, so we need to make sure that that connection secure so that you can build the products you want without [9:05] running into, you know, any sort of roadblocks. So, we've skipped ahead to when the checkpoint two is done, and that's the Treg plumbing. So, in plain words, we built the one pipe all outside data flows through. So, every question to a provider gets a price limit and a receipt number, so a retry is never paid twice. Its exact cost gets written down when you make the call. So, let's say in practice, right? We have decided to go after plumbers, like we said, cuz we're a marketing agency. This plumbing that's been set up between Claude and Treg means that when we log in and say we'd like some plumbers, they've been real [9:43] test calls run so that we can find plumbers to see each provider's answer to that question. So, if we ask provider one, I want some plumbers from the UK. Provider two, I want some plumbers. Three, four, five, six. We need to make sure that all that data from all of these providers is coming back in the same way and in the same shape and in [10:02] the same flavor, if that makes sense. Obviously, guys, you guys have any questions, you just have to pop them in the comments and I will reply to them immediately. The next thing we've done is decided or we've learned what a real call has taught us. So, we've called the Treg API, um you know, sort of sufficiently. [10:20] We've called it a lot of times. Four of the five email providers found the same email for an example lead. The one that missed charged X amount. So, we need to ask for the cheapest provider first and pay only for the hit. And three verifiers gave three different answers on the email. So, we asked it for an email from someone valid, risky, or catch-all. And that's why catch-all gets its own badge, right? So, all this means is that if we're going after plumbers in the UK, we want to make sure [10:49] that we're getting their verified email. Because if we get a catch-all email, we may as well just email like support@ or help@ or contact@. We want john.evans@plumbingwales.co.uk, right? So, that that's the whole point of this. And obviously, now, what I'm going to do is I'm going to be um just explaining phase three, right? And that's obviously sign-up, credits, animations, and the credit ledger so that when you clone this yourself, you'll be able to create a credit ledger so that new users can only use X amount [11:21] of credits. Something that I really love about Claude code, by the way, especially when it's working with sort of large data APIs, is that you can slowly see that it's feeding us back examples of the landing page and and the dashboards, etc. As you can see so far, we've got the home page leads, cleaning a list, [11:37] provider labs, billing, and settings. And all of this is done through the PRD. So, I haven't really touched any of this. It just keeps on coming back with updates. As you can see that we've got the credits that are going up and down. And we've now finished phase three, right? So, we're just going to run it on [11:52] localhost to show you the landing page. So, an absolutely beautiful landing page that has been done directly through the PRD guys that I'm going to put in the descriptions. This is my classic design brief that I always give Claude. You've got this really pretty like flow where obviously the leads are falling through this kind of waterfall and getting verified and found data, which [12:12] is great. So, tell us your business, get your ICP, we find the people, the waterfall verifies them, and that's it. So, this is just some examples of the design. So, you've got obviously people coming through with specific verification statuses. One provider got this pretty thing. And then from here you got this nice design where on scroll it just goes through different like segments like that. And then once [12:34] that's done, we go through here. Just some information about pricing, a you know, an FAQ, and then we'll go from there. So, if we start for free, you obviously just have to give your name, password, and then from there I'll use Cascade for B2B outreach and respect opt-outs. We're going to create an account. [12:55] So, from there, what's your website? Let's just say one of my websites is Dagent. And we'll say Dagent. Continue. What you sell? So, I sell AI receptionist tools to SMEs. Specifically, um plumbers, roofers, contractors. And the price point for Dagent we'll just say is $50 a month or 50 to 500. Let's say 50-500. Who do you think buys it? So, roofers, contractors, anyone who doesn't want to miss calls [13:35] from customers. Anyone who has blue-collar work and needs to answer the phones. Where are they in the UK the UK? Company size is typically 1 to 50, so we'll just leave those two there. How many leads do we want to start with? So, let's find phone numbers as well, that'd be good. Find 50 leads. Um so, it's going to be about $8 whatever it may be, and that's absolutely fine. And [14:03] we're going to click continue. And it's going to read our site, read the home pages, pull the brand, and then write our ideal customer profile. So, that all come up here, which is great. We sell an AI receptionist to small UK trade businesses like plumbers, electricians, roofers, builders, so they stop losing jobs when they cannot pick up the phone on the tools. So, that's [14:23] great. We're going to click continue. And now we've been sent into our beautiful landing page. So, for now, we're just going to continue with the build because this looks to be um just like you know, it's it's lacking logic, but we've got the nice sort of uh landing page done. We've got the nice demo page done. And then obviously from here then we've got the leads page, we've got the list cleaning, provider labs, billing, and settings, which is great. So, we're just going to go back to um the rest of the logic, and then [14:52] we'll do a full demo of it at the end. So, we have now hit phase three, and that is done, right? So, in plain words, Cascade now knows who we are. So, we make an account like we just saw, we get the free credits, we sign up with name, email, password. Password is scrambled with bcrypt, which is great. Um 30-day sessions in a cookie. Um so, the page is JavaScript. Um you know, so it sort of keeps up to date. The first account is [15:17] the admin. Everyone after is a customer. 50 free credits for everyone. The credit ledger, every grant top up, etc. Billing pages with a balance and ledger, right? So, how credits will work is you one starting a run, set aside the most it could cost, right? So, each result is paid from that hold, and whatever isn't used comes back when the run ends. You can never pay more [15:40] than the price you saw, which is great. Where Treg fits in, there are now two kinds of money. So, credits are what customers pay Cascade, Treg cost is what the admin pays Treg. Read from Treg's cost header on every call. So, something good about wrapping one of your new softwares around Treg is that you'll always know how much it's costing you so that you can produce that markup that keeps your business profitable, right? And what you can click, you can click start free, sign up properly, you land in the app, and then open billing settings is where you'll see the first ledger line, grant plus 50 welcome credits, [16:15] right? And next is phase four, which is the full onboarding card, which you just saw then, right? So, we'll skip ahead to when we've already done that. What we've produced now is up to checkpoint five. Cascade with Opus can now read our website and write who our ideal customers are, right? So, this is going to be the process, and this is the new logic that will add that I'll test shortly, where it now knows that with the example I gave, Day Agent, Day Agent is an AI receptionist for local businesses who are in the blue-collar industry, so plumbing, roofing, heating, [16:49] electrician, whatever it may be. So, basically, the pricing about pages and customers pages are chosen. The ICP summary types itself out word for word like you saw. And a real run that it's tested inside of Claude with Treg is that for TaxDome with a CRM for accounting firms, right? In the UK and US, took about 30 seconds, 3 cents in Treg calls, and a free count of around 22,000 firms and 13,000 decision makers from those firms. Now, where Treg fits, three Treg jobs, reading the page, the brand record, and the free count, all of that is done inside of Treg. The read is free for the [17:30] customer and paid by the admin. Every call is logged from the margin page, right? What you can click now as you sign up and onboard, you watch the ticks, the cost, the summary typing itself, and then from there, um we actually need to now build the find 50 leads button, right? So, it holds credits, finds companies, finds a decision maker at each, runs every person through um the email waterfall, etc., and then verifies them. It runs five rows at a time in the background and refunds whatever isn't new. So, [18:00] let's jump into that next. So, let's actually do a kind of um stock take on the phases so far. So, what we've got left to do is the engine. So, the run button, credit holding, finding companies, decision makers, that is the sort of um I suppose that the meat of this entire project is actually being able to, you know, um establish the waterfall enrichment so that we can find contacts ultimately, right? So, all of these different things, you know, login, databases, servers, everything, that's all great, but you've got to understand, guys, that when you're building projects products, especially B2B products, the people want the results, right? So, the [18:38] customers will want the result. And the um phase six, which is the engine, is the most important aspect of that. So, if we actually go through the rest of this, um we'll wait for the actual coding to be done, and then we'll cover uh phase six. So, we've skipped ahead to phase six um and the completion of it, [18:55] right? So, the design is done as well. So, one important thing is that we originally sort of asked for a sort of blue watercolor design, and it was kind of like tacky, so instead, I just asked for a more sort of um you know, a sort of ASCII kind of ASCII uh style uh simplistic kind of uh UI, right? So, again, uh there were a few things that I wanted to add to the landing page. The landing page isn't the most important thing, guys, but effectively, I just wanted it to look sort of in you know, enterprise grade. So, let's sort of cover exactly what phase six uh has [19:28] done, right? So, a five lead and 10 lead run of the UK and US accounting firms worked end-to-end. The 10 lead run found eight decision makers, five verified emails, and two catch-all emails, right? And it charged 38 of the 61 credits that we held for a couple of tests, right? [clears throat] So, Quick Enrich hit first, Kit caught what it missed, and the missed costs uh $0, right? So, in in so many words, that means that we have asked for data, it has asked multiple sources for the data, and only when source one didn't find the data, was source two asked for, right? So, in in other words, we've now [20:05] got a fully um you know, established waterfall enrichment tool that we can sell to clients right now. Now, things to note. So, it's just told us that ContactOut, the free first verifier, was rate limited on every call. So, the waterfall moves on to Kit because you can only do so many calls to ContactOut. Um and then obviously, a few different things like um how to top up credits and stuff like that. Now, what we've done for the design is that there's a monospace PRD, and we've banned um you know, monospace kind of font. So, in other words, I didn't like that those pixelated like, you know, [20:38] video game style fonts like Geist Mono. Um so, all the UI text is now Geist, and that's only a small thing, guys. It doesn't really matter for the logic of the project, but it's important that you guys are happy with how you upload these things. And a big thing is that you don't want your app to look vibe coded, and sometimes the mono fonts can look a bit vibe coded on your live apps. You've got to make sure that it doesn't look like slop. The next step that we actually launched was phase seven, which is the leads table. So, as you can see, it's actually starting to build the [21:06] leads table and show us the status of the enrichments and the status of the waterfall, right? So, you can see that it goes I know it's a bit pixelated, but you can see that it goes from quick enrich down to Kit, and then it continues and continues and then tells us what our margin is if we were to resell this, you know, software that we're building on top of Treg. So, let's skip ahead to when phase seven is completely done. So, phase seven, the leads table. In plain words, this is the screen people will screenshot. When a run works, each row is alive, right? So, a little droplet falls down a ladder of [21:37] providers until one finds the email, which is super cute. We've got that smooth sort of virtual table. We've got a cost on every row and status pills and live counters and a waterfall bar, so we know which provider found how many emails. We've got sorts, searching, filters, etc., bulk actions like CSV import and export, and a real run. Again, 10 accounting firms gave seven emails, five from quick enrich and two from Kit. Of the 61 credits 38 were charged and 23 refunded, and the Treg cost was 8 cents. So, in other words, we can do this at a scalable and effective level, and it's going to be cheap enough [22:15] that we can have a good margin on our SaaS product. There's a handful of other phases now. So, phase eight is cleaning a list, so being able to upload a list that you already have and then um Treg creating the waterfall enrichment process um to clean that list. Excuse [clears throat] me, we've got phase nine, which is billing and dashboards, phase 10, which is the provider lab. So, um almost like a bake-off chart, like how Treg is working and what providers inside of Treg's um you know, tool list are doing the the best. So, say if you were to upload a thousand leads, there would be a sort of, you know, fight to [22:50] the death of what provider was finding the most data, which is really, really cool. Um and then from there, we just got little things to make the actual dashboard a bit cuter and some fun stuff and that kind of thing. So, let's skip ahead to when those things are done and we'll demo the app. Now again guys, just the importance of using a good IDE, you know, something like Claude Code. I just asked it to get on with phase 8 to 11 and it's effectively set that up. So let's actually just go into the app and show the most important aspect um and we'll talk about how this [23:19] was built and then how you guys can just copy it and build it yourself. Now something I've done guys is I'm back in the dashboard and I just said, "Give me 10,000 more leads." because obviously we're making ourselves. Who's going to stop me? Uh you know, I'm I'm the founder of this, right? So I can give myself as many leads as I want. You just got to make sure that you don't give yourself like 10 million leads and then and then bankrupt yourself, right? So [23:44] let's um do a quick overview, right? Before we do the scrape of um what we're actually scraping, right? So again, on the onboarding that we did earlier, we said that we run a business that targets um UK owner-operated trades and home services firms because we are an AI receptionist, right? So there's about 160,000 companies and 62,000 of [24:08] them have a matching title, right? Now we can obviously change this if we want, which is great and looks really cool. Let's say let's actually bring that down, right? To 1 to 20. And um it it'll change it to 53,000, right? Let's just do it even smaller, right? Doesn't really matter too much. Now obviously we can go through the [24:27] whole ICP. It's done the exclusions for us as well so we're not targeting people that aren't relevant. So say like recruitment, staffing, and wholesale. So again, all of those are not they are not keywords um that are important for our scrape. And what [snorts] we're going to be able to do here is actually click find 50 leads. So it's going to tell us how many credits it is. Going to tell us um you know, the estimated 830 credits um with a maximum of 2,305, right? So like we said earlier on, um inside of this PRD you'll be able to set this up so that you aren't being [24:59] overcharged and you aren't charged, you know, being charged too much or too little. It'll always tell you exactly, um, you know, how much you're actually spending, which is great. So, let's click on find 50 leads and we'll see how it goes. So, already guys, we've started, um, Awesome. So, you can see now that it's going through each one in a sort of animated fashion, which is just absolutely insane. And from there, you can see that all of these are actually genuinely legit leads. Like, like they're great leads that we could reach out to, right? So, we've got the [25:31] emails. That was found by Quicken Rich. We've also got a mobile here, which is awesome. Um, Highcastle Homes, Genesis Homes, Tag Construction. All of these guys are important for our business, right? So, again, just to clarify, this is a mixture Um, this is a mixture of Treg and Claude Code and Opus creating a targeted list [25:56] for us and then going through it, right? So, as you can see, so far we've spent 130 credits, we found nine of 12 people. We've verified six and there's two catch-alls. We've done about 14 of the 50 leads. So, let's skip ahead to when this is done so we can get the full sort of picture of how Treg has produced the, um, the lead list from the waterfall enrichment. I do obviously just really like, um, the animation that this is produced because one by one now the leads are being queued and the people are being found, um, and I just like how we can all go through this and obviously [26:29] at the very end we'll be able to export this, we'll be able to, um, you know, change, uh, how things look, we'll be able to delete certain leads, um, and all of this again, guys, is just inside the PRD. Like, this was all effectively one shot by Claude Code and it helps that Treg has such, um, deep-rooted documentation, um, from the llms.txt. So, let's just Claude Code is just going to one shot this for you [26:52] whatever you're trying to build on Treg. Uh, And there it is, guys. So, what we've done is we've completed the list. Um we've used 300 credits. Um we have a chunk left, and we've got the verified contacts with their phones, verified emails, etc. Obviously, from there then, you can also, of course, sort of manage which ones you want to throw out. All statuses, let's say um [27:16] verified. We've got this list, which is fantastic. Um and we've got some of the mobile numbers. We've got the run credits, and how much it costed, and how much we can charge on the margin. Obviously, the the the customer of your software wouldn't see this. It's just for us and for the sort of demo purposes that you can see the markup of what you could charge, which is fantastic, right? Let's delete [27:36] that. Obviously, from there then, we can go to catch all our unconfirmed, and we can see this. And that went through a chunk of um enrichment tools uh through Treg, and obviously, we only found a few catch-alls. So, from this, that's obviously going to be slightly less um sort of like powerful, um but you can still obviously contact them, and then we and we've got direct mobiles, too, right? So, amazingly, excuse me, [clears throat] you'll see that there's also attempt history. So, we we went through ICP's Quick Enrich, Contact Out Kit, Million Verify, AI Arc, etc. Drop Leads, Lead Magic, etc. And from there, if we click [28:12] on Adam Welsh, cuz we did find his mobile, you'll see that we hit AI Arc, and then we even checked the mobile with HLR Lookup. So, what it's done is it's not only found um I'll obviously have to blur this out, cuz this is direct mobile, but um what we found is that we know that we can do the attempt history, find all of the different um sort of enrichment protocols, and then get the final result, and we know exactly how much it costed. So, at scale, we know that this could work for 1,000 customers, which is [28:42] just excellent. [28:48] What it's also done there is it's told us when we do call them what opening angle could we use. So, if a customer rings while you're up a ladder this afternoon, who answers and books the job? And that's because they're a scaffolding company. And we've got the person's LinkedIn profile, and we know their email came from Quick and Rich. So, that is the process, guys. You upload your ICP, you get a list of leads and a full list of um you know, of uh potential contacts, and then you just effectively reach out to them from there and just [29:18] and just make money, you know? Now, as always, guys, everything that we've talked about, all of the code, literally the entire code base, and the um PRD for this is going to be in the description. If you guys need help, just you know, just drop a comment, and I'll just answer as soon as I can. Um and [29:36] obviously, as always, just try out Treg. If you guys are building some kind of B2B tool or you need enrichment, obviously, Treg has thousands of tools, right? This is just because in my market, I know how Waterfall enrichment works. I know um the importance of finding good data. So, I could have done an SEO tool. I could have done a social media tool, but I've done this because it's my forte, and it's what I know how to do. So, the next step you would do is set up Stripe, and you would um you know, deploy this to Vercel or something like that, and you would have um a fully fledged [30:06] app. So, I'm just going to leave the video there. And if you guys have any questions, let me know, but I'll see you in the next one. --- About this transcript Read from YouTube's own caption track and laid out by ViewRank AI (https://viewrankai.com). ViewRank AI finds the videos already beating a creator's own average on Instagram, TikTok and YouTube Shorts, transcribes them from the audio itself in more than 60 languages, and turns what worked into new ideas and scripts. Free transcript tools, no account needed: https://viewrankai.com/tools How to read any video this way: https://viewrankai.com/llms.txt