Analyze 3 credits COMPUTE

TF-IDF Keyword Extraction API

Compute TF-IDF scores across a collection of text documents to identify the most distinctive keywords in each document relative to the corpus. Returns top-N keywords per document with their TF-IDF scores. Available as a simple REST API — POST your input, get structured JSON back. 3 credits per call, no rate limiting, works in any language with HTTP support.

Try it live →

How it works

POST a JSON object with your input data to /v1/analyze-text-tfidf. The API processes your request server-side using real computation (not mocked data) and returns a structured JSON response with your results and metadata including credits used and processing time.

Use cases

API Reference

POST https://slopshop.gg/v1/analyze-text-tfidf
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input parameters

ParameterTypeRequiredDescription
input string | object required The input data to process

Example response

{
  "data": {
    "result": "success",
    "processed": true
  },
  "meta": {
    "credits_used": 3,
    "engine": "real",
    "ms": 4
  }
}

Examples

Three real-world scenarios showing how developers use TF-IDF Keyword Extraction in production.

Example 1
Basic usage
Call TF-IDF Keyword Extraction with a simple input.
curl -X POST https://slopshop.gg/v1/analyze-text-tfidf \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "sample input data"}'
Example 2
Use in an agent pipeline
Call TF-IDF Keyword Extraction as a step in an automated workflow.
curl -X POST https://slopshop.gg/v1/analyze-text-tfidf \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "agent workflow input for tf-idf keyword extraction"}'
Example 3
Use from a serverless function
Invoke TF-IDF Keyword Extraction from a cloud function with real data.
curl -X POST https://slopshop.gg/v1/analyze-text-tfidf \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "production data payload"}'

Code examples

curl

curl -X POST https://slopshop.gg/v1/analyze-text-tfidf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "your data here"}'

Python

import requests

response = requests.post(
    "https://slopshop.gg/v1/analyze-text-tfidf",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"input": "your data here"}
)
result = response.json()
print(result["data"])

Node.js

const response = await fetch("https://slopshop.gg/v1/analyze-text-tfidf", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);

CLI

# Install the Slopshop CLI
npm install -g slopshop

# Set your API key
export SLOPSHOP_KEY=your_api_key

# Call analyze-text-tfidf
slop analyze-text-tfidf '{"input": "your data here"}'

Pricing

Credits per call
3
credits
Cost per call
$0.003
at Starter tier
Tier
COMPUTE
Pure compute

Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 3 credits per call — that's $0.003. See all pricing tiers.

Related APIs in Analyze

View the full API catalog · Try in playground · Documentation