I'm launching Trezy Classifier on ProductHunt! API tool to analyse bank transactions #190

05/09/2024
api
Transcript
Hello friends, I have a very exciting day today. An app that I have built is launching on Product Hunt. It's called Classify by tr. Classify is the name of the app, and TR is the company. So feel free to support it. And basically the app allows you to categorize, to analyze bank transactions. So, uh, if you're building a FinTech company, if you export bank transactions, uh, you want to make a sense of this information. And often this innovation is not very readable. You can get like a description of a transaction and amount. Often the export format from some banks could look more, less like this. Like you'd have a date, description, amount, currency, and that's it. But, uh, really if you analyze the transactions, you want to know the category. Like is it for rent? Is it for subscriptions? Is it for groceries? You want to know the information about the vendor, like is it for R McDonald's or is it from Uber? To better analyze the transactions. And this is what the app basically allows you to do. It is an API that lets you to send information about your transaction. It'll analyze this information and give you back a response with the information about the company that, uh, uh, send you the money or to whom you send the money and the economic activity and much more. So let's try to create account and see how it works and see how you can use it in a Rails application. 'cause here I have a Rails application that I imported this list of transactions and I want to add the, the information about like the category of the transaction, the, uh, company name that, uh, sent or receive this, uh, transaction, the logos and so on. So first of all, I will go and, um, sign up. Okay, signing up. And here I have created an account. I have 20,000 free credits, so 20,000 transactions that I can categorize for free. And I will go to the playground here. Okay, I need to get an API key. Let's create an API key. Here it is, uh, I will go back to the playground and uh, here is an example. So I can, uh, uh, add information about a transaction, like label amount, uh, control language, uh, click on enrich, it'll make, uh, it's, uh, analysis and give this kind of information. So here we have this, uh, uh, transition category, the company. So G seven is like a taxi service in France. The economic activity of this company, uh, logo, URL, in this case, if we didn't find the U logo, URL, but for most companies it would find the logo, URL. And we even have the website, yeah, this taxi service. So we know that, uh, this transaction was sent to G seven taxi. And you see we don't even have G seven anyway in the transaction label. But, uh, magically the tool managed to figure out that this specific, uh, thing is usually written in transactions to this, uh, uh, company. Okay, so let's make it work in the Ruben Rails application. So We'll are going to get this kind of information as an answer and we need to store it somewhere. So let's add a, a column that would be a classifier payload, and it would be adjacent column. We're going to keep this as Jason in our application. So, uh, let's say rails generate migration, add the classifier, payload two transactions. Let's open our migration. And, uh, we're going to store this information in JSON B. It's, uh, usually better and more performance than json. It is not accessible in the ES as of yet, but, uh, it is available this format in the Postgres scale. Okay, rails be migrate. Let's now display this classifier payload in our transactions list here and here. Okay, well, at the moment it is obviously empty. And uh, we, they're going to get this information from, uh, our API. So we're going to make this kind of, uh, request to the trace classifier, API for each of our transactions. We're going to get this response and they're going to store it in our, uh, application database. So let's create a new job that they're going to run for each transaction. I will name the job classify rails, generate job classifying. Let's open the classify job. They're going to run on a transaction. And how do we adopt this, uh, CRL request to our application? Well, this is actually quite, uh, easy. We can, um, uh, use JI PT or GitHub co palate for this. So I will say, um, I want to adapt this serial request to work with rails and fer day per day is, uh, a gem making the HTP request with rails. Okay, yeah, let's add the gem Faraday bundle, add fer day. And uh, here we have this example. So response, we have our API key that we received here. Uh, then they're going to have labeled will be transaction description, because here in the database we keep it as description amount, transaction amount, uh, country will be fr for all of them, and language will be French for all of them. So we are going to get this response and we are gonna say transaction, do update, classify a payload. Uh, we don't need to pause, just response.party. Let's try running this on one of our transactions. I'll open the rails Console transaction, yeah, equals transaction. First, let's have a look at this transaction. Here it is. Uh, I'm going to run this, uh, job on the transaction. So I will say, uh, classify job, perform now on the transaction. Okay, it performed. Let's have a look at the transaction again, it has the specified payload. Let's have a closer look dot ified payload. And here we see that, uh, the category is EMP 0 7 0 0. That is, uh, sellers and wages. We now know that this was a payment for a salary of an employee, and, uh, potentially we can get other information like, uh, the company and so on. Uh, for this one specifically, we didn't find the company. Maybe there was not enough information. Okay, let's, uh, have a look at our application. If, uh, this ified payload was saved, if we can have a look at it. Yes. So for the first transaction, we have this classified payload. Okay, now let's try categorizing all the transactions in our database so that we can run this, uh, job on, uh, each transaction, let's say transaction, all each, uh, do yes, do transaction, uh, trans and will run classified job dot perform Now on each transaction. And, and, and this is supposed to run, uh, the classification on each of our transactions. This can take, uh, a vial. Yes, you see it's happening. And if go back to Tracy, we can see, you see there are fewer and fewer free credits on our account. We have already categorized 15 in our 19 transactions, and we can have a look at them here. So, uh, you see for some of them, we even find the logos of the companies. Like, we know that this company, uh, has this website. It has, uh, uh, a logo. Let's try displaying the logos of, uh, the companies that they found. Um, so, uh, let's have, uh, another field for logo, company logo, and how can we get this? So, uh, let's see an example. Uh, and let's Again ask, uh, GitHub copilot. So transaction payload equals this. How can I, uh, display logo with image deck? This is going to help me pause this, uh, j payload and display the logos. In the meantime, in the console, you CVS still analyzing the transactions. It usually takes I think, half a second to analyze fun. You have already analyzed around 200 of them. Okay, let's see. So here we have, uh, this example code. Let's paste here. And let's see. Yeah, so you see it found a lot of, uh, company logos, looks, uh, really nice. So you would have the information about the, uh, economic activity, the, yeah, the category, the information about the companies that, uh, received all that sent you, uh, these, uh, bank transactions. And, uh, yeah, that's basically it. So, uh, this is an API for categorizing bank, uh, transactions and making sense, uh, out of them. Great for Fin the Companies. Again, feel free to support, uh, my project on, uh, product Hunt. Thanks for watching and see you in the next one.
0
Join the conversation
Sign in to access PRO lessons, access private repos, leave comments, create watch lists.
We collect your email address, name and username to create your account. We do not share your email address with anyone else.