Building an AI-Powered Meeting Transcript Summarizer using NodeJS and AI API
Tags: ai, node, api, javascript
Published: 2024-04-24 10:58:41

Virtual Meetings have become an essential part of corporate collaboration, serving as the de facto way that ideas are exchanged, decisions are made, and strategies are devised. However, the true value of meetings is often diluted by their length and the complexity of the discussions. This is why note-taking and effective summaries and action points are so important. Converting long, and often pointless discussions into short (actionable) summaries, meeting attendees can quickly catch up on meetings they missed, review decisions that were made, and understand discussions without having to sift through hours and hours of recordings.

We thought it would be cool to create our summarizer. If you don't have one already keep reading. This technical tutorial will guide you through creating a simple web application that summarizes daily meeting Transcripts using [ApyHub’s AI Summarize Document API](https://www.google.com/url?q=https://apyhub.com/utility/ai-summarize-documents&sa=D&source=editors&ust=1713957617787437&usg=AOvVaw1ZjQxToIWj51pYPYIt9p9o) using NodeJS.

[![AI Summarize Benefits](https://assets.apyhub.com/blog/ai-transcript-summarize/image1.png)](https://apyhub.com/blog/AI-summarization-API)

## Pre-requisites:

1. Access to [Google Meet](https://www.google.com/url?q=http://meet.google.com&sa=D&source=editors&ust=1713957617787942&usg=AOvVaw3LD3DDEmdml936V1UIJOs3) and permission to access meeting transcripts.
2. A preferred programming language environment (e.g., Python).
3. [ApyHub Account](https://www.google.com/url?q=http://apyhub.com&sa=D&source=editors&ust=1713957617788196&usg=AOvVaw2kd2z_ZUGR5V90HHo-rxrH).
4. GitHub CLI is installed on your computer.

## Step 1: Clone the GitHub repository

Open your terminal, and run this command:

```bash
git clone https://github.com/iamspathan/AI-Transcript-Summarizer.git
```

This command will clone the project in your local environment. Once the project is cloned, you can open the repository in the code editor.

## Step 2. Install Required Packages:

Here Node Package Manager (npm), we will install all the dependencies that our application needs to summarize the meeting transcribe.

```bash
npm install
```

## Step 3: Add your API Key to the index.js file.

Here, we will add our Secret API key from ApyHub. To generate an API key, you can visit the documentation page of [AI Summarize Document API](https://www.google.com/url?q=https://apyhub.com/utility/ai-summarize-documents&sa=D&source=editors&ust=1713957617789463&usg=AOvVaw1iwKRJBADftevsG7RviJad). Your secret looks like this ➡️
`apy-token: APY******************************************`

Copy this token and paste it in as shown in below code comment below.

```jsx
const express = require('express');
const fileUpload = require('express-fileupload');
const cors = require('cors');
const axios = require('axios');
const FormData = require('form-data');
const open = require('open');
const app = express();
const port = 3000;

app.use(cors());
app.use(fileUpload());

// Serve static files from the 'public' directory
app.use(express.static('public'));

app.post('/summarize', (req, res) => {
    console.log("summarixe called", req.files.file);
    if (!req.files || Object.keys(req.files).length === 0) {
        return res.status(400).send('No files were uploaded.');
    }

    // Assuming the file is attached to the request under the key 'file'
    const file = req.files.file;

    // Prepare the file to be sent using form-data
    const formData = new FormData();
    formData.append('file', file.data, file.name);

    // Set up the request headers, including the dynamic headers from form-data and the secret-apy token.
    const requestHeaders = {
        ...formData.getHeaders(),
        'apy-token': 'ADD YOUR OWN APY-TOKEN HERE'
    };

    // Call the AI Summarize API
    axios.post('https://api.apyhub.com/ai/summarize-documents/file', formData, { headers: requestHeaders })
        .then(apiResponse => {
            // Assuming the API returns JSON with a summary field
            console.log(apiResponse.data.data.summary);
            res.send({ summary: apiResponse.data.data.summary });
        })
        .catch(error => {
            console.error('Error calling the AI Summarize API:', error);
            res.status(500).send('Failed to summarize the document.');
        });
});

app.listen(port, () => {
    console.log(`Server running at http://localhost:${port}`);
    // Open the index.html file in the default browser
    open(`http://localhost:${port}`);
});

```

Once you’ve added the API key. Save the changes using the `Ctrl+S` Key.

## Step 4: Running Your Application

Once you’ve added the API key. Save the changes using Ctrl+S in your terminal, and run this command.:

```jsx
node index.js
```

That’s it :) As you can see, Now you can generate a meeting transcript anytime you want :)

![finaloutput](https://assets.apyhub.com/blog/ai-transcript-summarize/image2.gif)

Happy with the API? We have more….

[![CTA2](https://assets.apyhub.com/blog/ai-transcript-summarize/image4.png)](https://apyhub.com/catalog/artificial-intelligence)

Are you a NodeJS developer? Have a look at our blog series with tutorials.

[![CTA3](https://assets.apyhub.com/blog/ai-transcript-summarize/image5.png)](https://apyhub.com/blog/category/tutorials)