curl --request POST \
--url https://api.superx.so/v1/datasets/{id}/refine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"criterion": "supportive or neutral; not mean, sarcastic, or hostile",
"keep_matching": true,
"sort_by": "followers",
"limit": 200
}
'import requests
url = "https://api.superx.so/v1/datasets/{id}/refine"
payload = {
"criterion": "supportive or neutral; not mean, sarcastic, or hostile",
"keep_matching": True,
"sort_by": "followers",
"limit": 200
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
criterion: 'supportive or neutral; not mean, sarcastic, or hostile',
keep_matching: true,
sort_by: 'followers',
limit: 200
})
};
fetch('https://api.superx.so/v1/datasets/{id}/refine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.superx.so/v1/datasets/{id}/refine",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'criterion' => 'supportive or neutral; not mean, sarcastic, or hostile',
'keep_matching' => true,
'sort_by' => 'followers',
'limit' => 200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.superx.so/v1/datasets/{id}/refine"
payload := strings.NewReader("{\n \"criterion\": \"supportive or neutral; not mean, sarcastic, or hostile\",\n \"keep_matching\": true,\n \"sort_by\": \"followers\",\n \"limit\": 200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.superx.so/v1/datasets/{id}/refine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"criterion\": \"supportive or neutral; not mean, sarcastic, or hostile\",\n \"keep_matching\": true,\n \"sort_by\": \"followers\",\n \"limit\": 200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superx.so/v1/datasets/{id}/refine")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"criterion\": \"supportive or neutral; not mean, sarcastic, or hostile\",\n \"keep_matching\": true,\n \"sort_by\": \"followers\",\n \"limit\": 200\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "Jc9PxVU1FSkx4kzPuehGK",
"title": "Refined: Repliers to my launch post",
"source": "repliers",
"status": "ready",
"target_ref": "1234567890123456789",
"x_account_id": "1178367350552305665",
"ask_chat_id": null,
"columns": [
"handle",
"name",
"bio",
"text",
"followers",
"can_dm"
],
"row_count": 48,
"scanned_count": 64,
"total_estimate": 64,
"coverage_complete": true,
"has_people": true,
"created_at": "2026-09-10T10:20:00.000Z",
"expires_at": "2026-10-10T10:20:00.000Z"
},
"meta": {
"source_dataset_id": "VKcPAVU1FSkx4kzPuehGK",
"kept": 48,
"dropped": 14,
"unclear": 2,
"limited": 0,
"self_excluded": 0,
"credits_charged": 2
}
}Refine a dataset by what each person wrote
Judges each row’s own text against a natural-language criterion and
keeps or drops it, then optionally sorts and caps what is left into a
NEW dataset. The source dataset is never modified.
Only datasets whose rows carry text can be refined this way (a
repliers or quoters collection). Anything else answers 400: use the
profile filters on POST /v1/datasets instead.
Rows the classifier cannot judge confidently are kept and counted
as unclear, never silently dropped. Classification is best-effort:
read the kept rows before acting on them.
This endpoint can answer before the work is finished. Up to 100
rows with text classify inside the request and answer 200; more than
that answers 202 with a collecting dataset to poll through
GET /v1/datasets/{id}. If nothing was kept, the answer is 200 with
data: null and a note.
Cost. A refinement creates a dataset, so it counts against the
same 10 collections a day this account shares with Ask SuperX
(429 collection_quota_exceeded), and it costs AI credits, measured
from the classifier’s real cost. It spends no live-data allowance.
Needs a key with the write scope.
curl --request POST \
--url https://api.superx.so/v1/datasets/{id}/refine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"criterion": "supportive or neutral; not mean, sarcastic, or hostile",
"keep_matching": true,
"sort_by": "followers",
"limit": 200
}
'import requests
url = "https://api.superx.so/v1/datasets/{id}/refine"
payload = {
"criterion": "supportive or neutral; not mean, sarcastic, or hostile",
"keep_matching": True,
"sort_by": "followers",
"limit": 200
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
criterion: 'supportive or neutral; not mean, sarcastic, or hostile',
keep_matching: true,
sort_by: 'followers',
limit: 200
})
};
fetch('https://api.superx.so/v1/datasets/{id}/refine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.superx.so/v1/datasets/{id}/refine",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'criterion' => 'supportive or neutral; not mean, sarcastic, or hostile',
'keep_matching' => true,
'sort_by' => 'followers',
'limit' => 200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.superx.so/v1/datasets/{id}/refine"
payload := strings.NewReader("{\n \"criterion\": \"supportive or neutral; not mean, sarcastic, or hostile\",\n \"keep_matching\": true,\n \"sort_by\": \"followers\",\n \"limit\": 200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.superx.so/v1/datasets/{id}/refine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"criterion\": \"supportive or neutral; not mean, sarcastic, or hostile\",\n \"keep_matching\": true,\n \"sort_by\": \"followers\",\n \"limit\": 200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superx.so/v1/datasets/{id}/refine")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"criterion\": \"supportive or neutral; not mean, sarcastic, or hostile\",\n \"keep_matching\": true,\n \"sort_by\": \"followers\",\n \"limit\": 200\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "Jc9PxVU1FSkx4kzPuehGK",
"title": "Refined: Repliers to my launch post",
"source": "repliers",
"status": "ready",
"target_ref": "1234567890123456789",
"x_account_id": "1178367350552305665",
"ask_chat_id": null,
"columns": [
"handle",
"name",
"bio",
"text",
"followers",
"can_dm"
],
"row_count": 48,
"scanned_count": 64,
"total_estimate": 64,
"coverage_complete": true,
"has_people": true,
"created_at": "2026-09-10T10:20:00.000Z",
"expires_at": "2026-10-10T10:20:00.000Z"
},
"meta": {
"source_dataset_id": "VKcPAVU1FSkx4kzPuehGK",
"kept": 48,
"dropped": 14,
"unclear": 2,
"limited": 0,
"self_excluded": 0,
"credits_charged": 2
}
}Authorizations
A SuperX API key ("sxk_..."), created in the SuperX app under Account > API / MCP / CLI. Keys are server-side secrets.
Path Parameters
The dataset id from GET /v1/datasets.
^[A-Za-z0-9_-]{1,64}$Body
What the rows to match look like, judged on each row's own text, e.g. "supportive or neutral; not mean, sarcastic, or hostile".
3 - 500true keeps the rows that MATCH the criterion; false keeps the rows that do NOT.
Sort the kept rows descending before the limit is applied.
followers, likes, none Keep at most this many rows after filtering and sorting.
1 <= x <= 1000Title for the new dataset. A sensible one is generated when omitted.
120Which of your accounts to refine as. Omit for the main account.