📝🔎 iApp Text Summarization API [version 2]
📝🔎 ระบบสรุปข้อความภาษาไทยอัตโนมัติ
Welcome to iApp Thai Text Summarization API, an AI product developed by iApp Technology Co., Ltd. Our API provides powerful text summarization capabilities for Thai language content, condensing long texts into concise summaries while preserving key information.
Try Demo
Getting Started
Prerequisites
- Text input (English or Thai)
- Maximum output tokens: 8192
- API key from iApp Technology
Quick Start
- Fast processing with concurrent batch support
- Multiple summarization styles
- Bilingual support (EN/TH)
Key Features
- AI-powered text summarization
- Multiple summarization styles
- Bilingual support (English/Thai)
- Batch processing capability
- Customizable output length
Summarization Styles
| Style | Description | Best For |
|---|---|---|
| standard | Formal summary with introduction and conclusion | Business documents, reports |
| clarify | Includes notes on unresolved points | Technical documents, discussions |
| friendly | Simple, easy-to-understand summary | General content, blogs |
API Endpoints
| Endpoint | Method | Description | Cost |
|---|---|---|---|
/v3/store/nlp/thai-text-summary/v1Legacy: /thai-summary, /text-summarization | POST | Summarize Thai text (Version 1) | 1 IC per 400 characters |
/v3/store/nlp/thai-text-summary-v2Legacy: /v2/text/summarize | POST | Summarize Thai text with multiple styles (Version 2) | 1 IC per 400 characters |
API Usage
Endpoints
POST /v2/text/summarize- Summarize single textPOST /v2/text/summarize/batch- Summarize multiple textsGET /v2/text/health- Check API status
Parameters
Single Text Summarization
{
"text": "string", // Required: Text to summarize
"style": "standard", // Optional: "standard" | "clarify" | "friendly"
"language": "th", // Optional: "en" | "th"
"max_output_tokens": 8192 // Optional: Max length of summary
}
Batch Summarization
{
"texts": ["string"], // Required: Array of texts to summarize
"style": "standard", // Optional: "standard" | "clarify" | "friendly"
"language": "th", // Optional: "en" | "th"
"max_output_tokens": 8192 // Optional: Max length of summary
}
API Request Examples
Using cURL:
# Single text summarization
curl -X POST "https://api.iapp.co.th/v2/text/summarize" \
-H "Content-Type: application/json" \
-H "apikey: YOUR_API_KEY" \
-d '{
"text": "Your text to summarize",
"style": "standard",
"language": "en",
"max_output_tokens": 500
}'
# Batch summarization
curl -X POST "https://api.iapp.co.th/v2/text/summarize/batch" \
-H "Content-Type: application/json" \
-H "apikey: YOUR_API_KEY" \
-d '{
"texts": ["First text", "Second text"],
"style": "standard",
"language": "en",
"max_output_tokens": 500
}'
Using Python:
import requests
# Single text summarization
response = requests.post(
"https://api.iapp.co.th/v2/text/summarize",
headers={"apikey": "YOUR_API_KEY"},
json={
"text": "Your text to summarize",
"style": "standard",
"language": "en",
"max_output_tokens": 500
}
)
# Batch summarization
response = requests.post(
"https://api.iapp.co.th/v2/text/summarize/batch",
headers={"apikey": "YOUR_API_KEY"},
json={
"texts": ["First text", "Second text"],
"style": "standard",
"language": "en",
"max_output_tokens": 500
}
)
Best Practices
- Choose the appropriate style for your content type
- Adjust max_output_tokens based on your needs:
- Shorter summaries (200-500 tokens): Quick overviews
- Medium summaries (500-1000 tokens): Detailed summaries
- Longer summaries (1000+ tokens): Comprehensive coverage
- For batch processing, consider the number of concurrent requests
- Use the clarify style for technical content that needs additional context
Code Examples
Curl
curl -X POST https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2 \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Your Thai text here", "style": "general"}'
Python
import requests
import json
url = "https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2"
headers = {
"apikey": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {"text": "Your Thai text here", "style": "general"}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
JavaScript
const axios = require("axios");
const config = {
method: "post",
url: "https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2",
headers: {
apikey: "YOUR_API_KEY",
"Content-Type": "application/json",
},
data: {"text": "Your Thai text here", "style": "general"},
};
axios(config)
.then((response) => console.log(response.data))
.catch((error) => console.log(error));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => '{"text": "Your Thai text here", "style": "general"}',
CURLOPT_HTTPHEADER => array(
'apikey: YOUR_API_KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Swift
import Foundation
let url = URL(string: "https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("YOUR_API_KEY", forHTTPHeaderField: "apikey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let jsonData = try! JSONSerialization.data(withJSONObject: {"text": "Your Thai text here", "style": "general"})
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data {
print(String(data: data, encoding: .utf8)!)
}
}
task.resume()
Kotlin
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody
val client = OkHttpClient()
val json = """
{"text": "Your Thai text here", "style": "general"}
""".trimIndent()
val requestBody = json.toRequestBody("application/json".toMediaTypeOrNull())
val request = Request.Builder()
.url("https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2")
.addHeader("apikey", "YOUR_API_KEY")
.post(requestBody)
.build()
client.newCall(request).execute().use { response ->
println(response.body?.string())
}
Java
import okhttp3.*;
OkHttpClient client = new OkHttpClient();
String json = "{"text": "Your Thai text here", "style": "general"}";
RequestBody body = RequestBody.create(
MediaType.parse("application/json"),
json
);
Request request = new Request.Builder()
.url("https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2")
.addHeader("apikey", "YOUR_API_KEY")
.post(body)
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
}
Dart
import 'package:http/http.dart' as http;
import 'dart:convert';
var headers = {
'apikey': 'YOUR_API_KEY',
'Content-Type': 'application/json'
};
var data = {"text": "Your Thai text here", "style": "general"};
var response = await http.post(
Uri.parse('https://api.iapp.co.th/v3/store/nlp/thai-text-summary/v2'),
headers: headers,
body: jsonEncode(data)
);
print(response.body);
Pricing
| AI API Service Name | Endpoint | IC Per Characters | On-Premise |
|---|---|---|---|
| Thai Text Summarizer | iapp_thai_text_summarization_v1 | 1 IC/400 Characters | Contact |