Skip to content

sharpapi/sharpapi-node-summarize-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SharpAPI GitHub cover

Text Summarizer API for Node.js

📄 Generate concise summaries of long text — powered by SharpAPI AI.

npm version License

SharpAPI Text Summarizer condenses long articles, documents, and content into concise summaries. Perfect for content curation, creating executive summaries, and improving content digestibility.


📋 Table of Contents

  1. Requirements
  2. Installation
  3. Usage
  4. API Documentation
  5. Examples
  6. Use Cases
  7. API Endpoint
  8. Related Packages
  9. License

Requirements

  • Node.js >= 16.x
  • npm or yarn

Installation

Step 1. Install the package via npm:

npm install @sharpapi/sharpapi-node-summarize-text

Step 2. Get your API key

Visit SharpAPI.com to get your API key.


Usage

const { SharpApiSummarizeTextService } = require('@sharpapi/sharpapi-node-summarize-text');

const apiKey = process.env.SHARP_API_KEY; // Store your API key in environment variables
const service = new SharpApiSummarizeTextService(apiKey);

const text = 'Long article text that needs to be summarized...';

async function processText() {
  try {
    // Submit processing job
    const statusUrl = await service.summarize(text);
    console.log('Job submitted. Status URL:', statusUrl);

    // Fetch results (polls automatically until complete)
    const result = await service.fetchResults(statusUrl);
    console.log('Result:', result.getResultJson());
  } catch (error) {
    console.error('Error:', error.message);
  }
}

processText();

API Documentation

Methods

The service provides methods for processing content asynchronously. All methods return a status URL for polling results.

Parameters:

  • content (string, required): The content to process
  • language (string, optional): Output language
  • voice_tone (string, optional): Desired tone (e.g., professional, casual)
  • context (string, optional): Additional context for better results

For complete API specifications, see the Postman Documentation.

Response Format

The API returns structured JSON data. Response format varies by endpoint - see documentation for details.


Examples

Basic Example

const { SharpApiSummarizeTextService } = require('@sharpapi/sharpapi-node-summarize-text');

const service = new SharpApiSummarizeTextService(process.env.SHARP_API_KEY);

// Customize polling behavior if needed
service.setApiJobStatusPollingInterval(10);  // Poll every 10 seconds
service.setApiJobStatusPollingWait(180);     // Wait up to 3 minutes

// Use the service
// ... (implementation depends on specific service)

For more examples, visit the Product Page.


Use Cases

  • Content Curation: Create brief overviews of long articles
  • Executive Summaries: Generate business document summaries
  • News Aggregation: Summarize news articles for quick reading
  • Research: Condense research papers and reports
  • Email Digests: Create brief summaries for newsletters
  • Product Descriptions: Generate short descriptions from detailed content

API Endpoint

POST /content/summarize

For detailed API specifications, refer to:


Related Packages


License

This project is licensed under the MIT License. See the LICENSE.md file for details.


Support


Powered by SharpAPI - AI-Powered API Workflow Automation

About

SharpAPI.com Node.js SDK for summarizing text

Resources

Stars

Watchers

Forks

Packages

No packages published