npm package: @sharpapi/sharpapi-node-detect-ai
Description: SharpAPI.com Node.js SDK for detecting AI-generated content in text
Author: Dawid Makowski
Latest version: 1.0.1

![SharpAPI GitHub cover](https://sharpapi.com/sharpapi-github-php-bg.jpg "SharpAPI Node.js Client")

# AI Content Detector API for Node.js

## Detect AI-generated content in text — powered by SharpAPI AI.

[![npm version](https://img.shields.io/npm/v/@sharpapi/sharpapi-node-detect-ai.svg)](https://www.npmjs.com/package/@sharpapi/sharpapi-node-detect-ai)
[![License](https://img.shields.io/npm/l/@sharpapi/sharpapi-node-detect-ai.svg)](https://github.com/sharpapi/sharpapi-node-detect-ai/blob/master/LICENSE.md)

**SharpAPI AI Content Detector** analyzes text to determine if it was generated by AI (ChatGPT, Claude, etc.). Returns likelihood percentage, assessment, detailed reasoning, and flagged portions of text with specific patterns detected.

---

## Table of Contents

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Usage](#usage)
4. [API Documentation](#api-documentation)
5. [Response Format](#response-format)
6. [Examples](#examples)
7. [Use Cases](#use-cases)
8. [API Endpoint](#api-endpoint)
9. [Related Packages](#related-packages)
10. [License](#license)

---

## Requirements

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

---

## Installation

### Step 1. Install the package via npm:

```bash
npm install @sharpapi/sharpapi-node-detect-ai
```

### Step 2. Get your API key

Visit [SharpAPI.com](https://sharpapi.com/) to get your API key.

---

## Usage

```javascript
const { SharpApiDetectAiService } = require('@sharpapi/sharpapi-node-detect-ai');

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

const text = `In conclusion, this comprehensive analysis delves into the multifaceted
aspects of modern technology. Furthermore, it is crucial to leverage these innovative
solutions to foster growth and streamline operations.`;

async function analyzeText() {
  try {
    // Submit processing job
    const statusUrl = await service.detectAiContent(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);
  }
}

analyzeText();
```

---

## API Documentation

### Methods

#### `detectAiContent(text)`

Analyzes the provided text to detect if it was generated by AI.

**Parameters:**
- `text` (string, required): The text content to analyze

**Returns:** Promise<string> - Status URL for polling results


---

## Use Cases

- **Academic Integrity**: Detect AI-generated essays and assignments
- **Content Verification**: Verify authenticity of submitted articles and blog posts
- **Publishing**: Screen manuscripts for AI-generated content
- **Hiring**: Analyze cover letters and writing samples
- **SEO/Content Marketing**: Ensure content meets quality and originality standards
- **Social Media**: Identify AI-generated comments or posts
- **Legal/Compliance**: Verify document authenticity

---

## License

This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.

---

## Support

- **Documentation**: [SharpAPI.com Documentation](https://sharpapi.com/documentation)
- **Issues**: [GitHub Issues](https://github.com/sharpapi/sharpapi-node-detect-ai/issues)
- **Email**: contact@sharpapi.com