# Named Entity Recognition (NER) & Sentiment Analysis API (`lofomachines/named-entity-recognition-api`) Actor

🔥 Only 0.002$ 🔥 Named Entity Recognition (NER), entity extraction and sentiment analysis API for bulk text, CSV and Excel files. Analyze reviews, social media posts, customer feedback, surveys, support tickets, transcripts and much more, give your Agent bulk excel rows classification ability.

- **URL**: https://apify.com/lofomachines/named-entity-recognition-api.md
- **Developed by:** [Lofomachines](https://apify.com/lofomachines) (community)
- **Categories:** AI, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 text processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Named Entity Extraction & Sentiment Analysis API

Turn unstructured text into clean, ready-to-use intelligence. Paste comments, reviews, support tickets, social posts, transcripts, survey answers, news snippets, or a CSV/Excel file and get a structured result for every row: sentiment, named entities, or both.

Built for teams who need reliable **named entity extraction**, **sentiment analysis**, **brand monitoring**, and **text classification** at scale—without manual tagging, spreadsheet clean-up, or accounts to connect.

### What you get

- **One result per text** — every input line or file row is returned in the Output tab as soon as it is ready.
- **Clear sentiment** — `positive`, `neutral`, or `negative`.
- **Useful named entities** — up to 50 relevant people, organizations, brands, products, places, events, and other specific references per text.
- **Original text preserved** — exports always include the exact text that was analyzed. File-based runs also preserve the original file row for easy joining.
- **Bulk-friendly workflow** — add texts one per row or upload a single-sheet CSV, XLS, or XLSX file.
- **CSV, Excel, JSON, and API ready** — use the dataset directly in a dashboard, workflow, CRM, or AI agent.

### Who this is for

- Social listening and reputation teams
- Brand, product, and customer-experience teams
- Market researchers and analysts
- Agencies managing multi-brand campaigns
- Support, success, and VOC teams
- Newsrooms, researchers, and intelligence teams
- Sales and operations teams enriching text-heavy data
- Builders connecting Apify to Make, Zapier, n8n, or an AI agent

### Popular use cases

#### Social media listening and brand intelligence

Paste social posts, comments, community discussions, or video transcriptions to identify brand names, products, people, locations, and campaign themes while measuring the tone around each mention. Use it to spot praise, complaints, competitor mentions, creators, and emerging conversations.

#### Customer review analysis

Upload a review export and immediately see the sentiment of every review plus the products, branches, people, or services customers mention most often. Export the dataset to prioritize response queues and identify recurring issues.

#### Voice of customer and survey analysis

Classify open-ended survey answers, NPS feedback, chat transcripts, and support tickets. Surface references to features, teams, plans, regions, and competitors without forcing respondents into rigid form fields.

#### PR and news monitoring

Analyze articles, press coverage, newsletters, and media summaries in bulk. Capture companies, executives, products, events, and places, then use the sentiment label as a quick direction-of-coverage signal.

#### Podcast, video, and meeting transcript intelligence

Feed in a transcript from an interview, webinar, call, or video. Find the people, brands, products, and places that matter, then use the output to create clips, show notes, follow-ups, or research lists.

#### App, marketplace, and e-commerce feedback

Turn raw product feedback into a usable table. Identify which feature, SKU, delivery provider, seller, or location each comment refers to, and compare how customers feel across the data.

### Input

Choose what to extract, then use one of two simple ways to supply text:

| Field | What to do |
|---|---|
| **What would you like to extract?** | Select Sentiment, Named entities, or both. |
| **Texts to analyze** | Add one text per row with the bulk input. Each row accepts up to 2,500 characters. |
| **CSV or Excel file** | Upload a CSV, XLS, or XLSX file with one sheet for a larger batch. |
| **Text column name** | For an uploaded file, enter the header of the column that contains the text. |
| **Convert entity names to lowercase** | Optional—helpful for matching and deduplicating names across exports. |

#### Example: pasted text

```json
{
  "analysisType": "both",
  "texts": ["I love the new Acme Cloud product from Milan.", "The delivery from Northwind was disappointing."],
  "lowercaseEntities": true
}
````

#### Example: file analysis

```json
{
  "analysisType": "both",
  "inputFile": "https://example.com/customer-feedback.xlsx",
  "textColumn": "review_text",
  "lowercaseEntities": false
}
```

### Output

The default dataset contains one clean record per text. In the Apify Output tab, use **Overview** for the analysis table or **Original file rows** to keep file columns beside the classifications.

| Field | Meaning |
|---|---|
| `originalText` | The original text submitted for analysis. |
| `sentiment` | `positive`, `neutral`, or `negative`; empty when sentiment was not selected. |
| `entities` | An array of up to 50 relevant named entities, or `null` when a file row has no text. |
| `entityCount` | Number of returned entities, or `null` when a file row has no text. |
| `error` | A user-readable message only if that text could not be processed. |

#### Example output

```json
{
  "rowNumber": 1,
  "originalText": "I love the new Acme Cloud product from Milan.",
  "sentiment": "positive",
  "entities": ["acme cloud", "milan"],
  "entityCount": 2,
  "error": null
}
```

### Connect it to your workflow

- **Make or Zapier:** send new reviews, form responses, tickets, or social posts to the Actor, then write sentiment and entities back to your sheet, CRM, or alerting tool.
- **n8n:** run scheduled batches from a database or spreadsheet, then route negative feedback to a support queue and entity-rich records to a research workflow.
- **Google Sheets or Excel:** export the dataset after every run for a clean, filterable analysis table.
- **AI agents and MCP:** the Actor’s clear input and output schemas make it easy for Claude, Codex, Hermes, and other agent workflows to understand the available inputs and consume structured results.
- **Apify API:** start a run with JSON input and fetch the default dataset whenever your workflow is ready.

### Discover more Lofomachines Actors

Build a complete listening and intelligence workflow with these related Actors:

- [Sentiment and Topics Text Classifier](https://apify.com/lofomachines/sentiment-and-topics-text-classifier)
- [Fast Audio and Video Transcription](https://apify.com/lofomachines/fast-audio-and-video-transcription)
- [TikTok Transcription AI](https://apify.com/lofomachines/tiktok-transcription-ai)
- [Brand Monitoring AI](https://apify.com/lofomachines/brand-monitoring-ai)
- [AI Media Monitor](https://apify.com/lofomachines/ai-media-monitor)

**[Explore all Lofomachines Actors →](https://apify.com/lofomachines)**

# Actor input Schema

## `analysisType` (type: `string`):

Choose sentiment, entities, or both.

## `texts` (type: `array`):

Add one text per row with the Add button. Leave empty when uploading a file. Each text can contain up to 2,500 characters.

## `inputFile` (type: `string`):

Optional. Upload a CSV, XLS, or XLSX file with a single sheet. Leave empty when pasting text.

## `textColumn` (type: `string`):

Only for uploaded files. Type the exact header of the column that contains the review, post, comment, transcript, or other text you want analyzed. For example, enter review\_text if your file has a review\_text column. All other columns are preserved in the results.

## `lowercaseEntities` (type: `boolean`):

Turn this on for easier matching, filtering, and deduplication.

## Actor input object example

```json
{
  "analysisType": "both",
  "texts": [
    "I love the new Acme Cloud product from Milan.",
    "The delivery from Northwind was disappointing."
  ],
  "lowercaseEntities": false
}
```

# Actor output Schema

## `allFields` (type: `string`):

All text-analysis results in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "texts": [
        "I love the new Acme Cloud product from Milan.",
        "The delivery from Northwind was disappointing."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lofomachines/named-entity-recognition-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "texts": [
        "I love the new Acme Cloud product from Milan.",
        "The delivery from Northwind was disappointing.",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("lofomachines/named-entity-recognition-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "texts": [
    "I love the new Acme Cloud product from Milan.",
    "The delivery from Northwind was disappointing."
  ]
}' |
apify call lofomachines/named-entity-recognition-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=lofomachines/named-entity-recognition-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Named Entity Recognition (NER) & Sentiment Analysis API",
        "description": "🔥 Only 0.002$ 🔥 Named Entity Recognition (NER), entity extraction and sentiment analysis API for bulk text, CSV and Excel files. Analyze reviews, social media posts, customer feedback, surveys, support tickets, transcripts and much more, give your Agent bulk excel rows classification ability.",
        "version": "1.0",
        "x-build-id": "eMcZiz6enSqw8Pj95"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lofomachines~named-entity-recognition-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lofomachines-named-entity-recognition-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/lofomachines~named-entity-recognition-api/runs": {
            "post": {
                "operationId": "runs-sync-lofomachines-named-entity-recognition-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/lofomachines~named-entity-recognition-api/run-sync": {
            "post": {
                "operationId": "run-sync-lofomachines-named-entity-recognition-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "analysisType": {
                        "title": "What would you like to extract?",
                        "enum": [
                            "sentiment",
                            "entities",
                            "both"
                        ],
                        "type": "string",
                        "description": "Choose sentiment, entities, or both.",
                        "default": "both"
                    },
                    "texts": {
                        "title": "Texts to analyze",
                        "maxItems": 10000,
                        "type": "array",
                        "description": "Add one text per row with the Add button. Leave empty when uploading a file. Each text can contain up to 2,500 characters.",
                        "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2500
                        }
                    },
                    "inputFile": {
                        "title": "CSV or Excel file",
                        "pattern": "^https?://.+",
                        "type": "string",
                        "description": "Optional. Upload a CSV, XLS, or XLSX file with a single sheet. Leave empty when pasting text."
                    },
                    "textColumn": {
                        "title": "Column that contains the text to analyze (exact name)",
                        "maxLength": 50,
                        "type": "string",
                        "description": "Only for uploaded files. Type the exact header of the column that contains the review, post, comment, transcript, or other text you want analyzed. For example, enter review_text if your file has a review_text column. All other columns are preserved in the results."
                    },
                    "lowercaseEntities": {
                        "title": "Convert entity names to lowercase",
                        "type": "boolean",
                        "description": "Turn this on for easier matching, filtering, and deduplication.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
