このエンドポイントが役立つこと
レスポンスには、一致する 検索、公開されているコンテキスト、さらに結果がある場合のページネーションデータが含まれます。
使用に適した場面
オブジェクトの正確な ID がわからず、まず関連する候補を見つける必要がある場合に「検索クエリによる投稿」を使用します。
まず結果と一般的なワークフローを確認し、次にパラメーターと動作するリクエスト例に進んでください。
レスポンスには、一致する 検索、公開されているコンテキスト、さらに結果がある場合のページネーションデータが含まれます。
オブジェクトの正確な ID がわからず、まず関連する候補を見つける必要がある場合に「検索クエリによる投稿」を使用します。
顧客向けおよび社内の画面に、Threads のデータ検索を追加します。
クエリで候補を見つけ、関連するオブジェクトを保存して後でエンリッチします。
トピック、クリエイター、競合の分析のために結果セットを収集します。
どちらのバージョンも同じタスクを解決し、同じパラメーターを受け付けます。切り替えを使ってレスポンス構造を比較し、クライアントが想定するバージョンを選んでください。
このページでバージョンを切り替えると、同じドキュメント URL でレスポンス構造を比較できます。
認証、必須パラメーター、リクエストの形は V1 と V2 で同じです。実際には、エンドポイントのパスを組み立てるときとレスポンスを読み取るときにバージョンを選びます。
主な違いはレスポンスのエンベロープです。新しい連携では V2 を使用し、既存のクライアント契約との互換性が必要な場合にのみ V1 を残してください。
どちらのバージョンでも、同じ API キーのヘッダーと同じクエリパラメーターを使用します。このドキュメントでは、まず共通のパラメーターを示し、次に各バージョンのパスとコードスニペットを示します。
| パラメーター | 必須 | 型 | 例 | 説明 |
|---|---|---|---|---|
query |
はい | str |
technology |
ユーザーが入力した検索クエリ。 |
cursor |
いいえ | str | None |
QVFIUmVhZF9jdXJzb3I= |
前のレスポンスで返された次のページのカーソル。最初のページでは省略します。 |
tag |
いいえ | top | recent | None |
top |
Optional Threads post search tab. Example: top. |
エンドポイントの正確なパス、URL の例、コードスニペットをコピーするときにバージョンを選んでください。上のパラメーター一覧は変わりません。
GET /api/v2/threads.net/search/posts-by-querycurl --request GET \
--url "https://www.scrapestorm.net/api/v2/threads.net/search/posts-by-query" \
--header "X-API-Key: 00000000-0000-4000-8000-000000000000" \
--get --data-urlencode 'query=technology' \
# Optional parameters:
# --data-urlencode 'cursor=QVFIUmVhZF9jdXJzb3I='
# --data-urlencode 'tag=top'
from urllib.parse import urljoin
import requests
BASE_URL = "https://www.scrapestorm.net"
ENDPOINT = "/api/v2/threads.net/search/posts-by-query"
HEADERS = {"Accept": "application/json", "X-API-Key": "00000000-0000-4000-8000-000000000000"}
params = {
"query": "technology",
}
# Optional parameters
# params["cursor"] = "QVFIUmVhZF9jdXJzb3I="
# params["tag"] = "top"
with requests.Session() as session:
response = session.request(
method="GET",
url=urljoin(BASE_URL, ENDPOINT),
headers=HEADERS,
params=params,
timeout=30,
)
response.raise_for_status()
payload = response.json()
print(payload)
const BASE_URL = "https://www.scrapestorm.net";
const endpoint = "/api/v2/threads.net/search/posts-by-query";
const params = new URLSearchParams({
query: "technology",
});
// Optional parameters
// params.set("cursor", "QVFIUmVhZF9jdXJzb3I=");
// params.set("tag", "top");
const response = await fetch(`${BASE_URL}${endpoint}?${params.toString()}`, {
method: "GET",
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}
const payload = await response.json();
console.log(payload);
import axios from "axios";
const client = axios.create({
baseURL: "https://www.scrapestorm.net",
timeout: 30000,
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
const params = {
query: "technology",
};
// Optional parameters
// params.cursor = "QVFIUmVhZF9jdXJzb3I=";
// params.tag = "top";
const { data: payload } = await client.request({
method: "GET",
url: endpoint,
params,
});
console.log(payload);
<?php
declare(strict_types=1);
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
$client = new Client([
'base_uri' => "https://www.scrapestorm.net",
'timeout' => 30.0,
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => "00000000-0000-4000-8000-000000000000",
],
]);
$query = [
"query" => "technology",
];
// Optional parameters
// $query["cursor"] = "QVFIUmVhZF9jdXJzb3I=";
// $query["tag"] = "top";
try {
$response = $client->request("GET", "/api/v2/threads.net/search/posts-by-query", [
'query' => $query,
]);
$payload = json_decode(
(string) $response->getBody(),
true,
512,
JSON_THROW_ON_ERROR
);
var_dump($payload);
} catch (GuzzleException $e) {
throw $e;
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"time"
)
func main() {
baseURL := "https://www.scrapestorm.net"
endpoint := "/api/v2/threads.net/search/posts-by-query"
params := url.Values{}
params.Set("query", "technology")
// Optional parameters
// params.Set("tag", "top")
req, err := http.NewRequest(
"GET",
fmt.Sprintf("%s%s?%s", baseURL, endpoint, params.Encode()),
nil,
)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("X-API-Key", "00000000-0000-4000-8000-000000000000")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var payload any
if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil {
panic(err)
}
fmt.Printf("%+v\n", payload)
}
エンドポイントの正確なパス、URL の例、コードスニペットをコピーするときにバージョンを選んでください。上のパラメーター一覧は変わりません。
GET /api/v1/threads.net/search/posts-by-querycurl --request GET \
--url "https://www.scrapestorm.net/api/v1/threads.net/search/posts-by-query" \
--header "X-API-Key: 00000000-0000-4000-8000-000000000000" \
--get --data-urlencode 'query=technology' \
# Optional parameters:
# --data-urlencode 'cursor=QVFIUmVhZF9jdXJzb3I='
# --data-urlencode 'tag=top'
from urllib.parse import urljoin
import requests
BASE_URL = "https://www.scrapestorm.net"
ENDPOINT = "/api/v1/threads.net/search/posts-by-query"
HEADERS = {"Accept": "application/json", "X-API-Key": "00000000-0000-4000-8000-000000000000"}
params = {
"query": "technology",
}
# Optional parameters
# params["cursor"] = "QVFIUmVhZF9jdXJzb3I="
# params["tag"] = "top"
with requests.Session() as session:
response = session.request(
method="GET",
url=urljoin(BASE_URL, ENDPOINT),
headers=HEADERS,
params=params,
timeout=30,
)
response.raise_for_status()
payload = response.json()
print(payload)
const BASE_URL = "https://www.scrapestorm.net";
const endpoint = "/api/v1/threads.net/search/posts-by-query";
const params = new URLSearchParams({
query: "technology",
});
// Optional parameters
// params.set("cursor", "QVFIUmVhZF9jdXJzb3I=");
// params.set("tag", "top");
const response = await fetch(`${BASE_URL}${endpoint}?${params.toString()}`, {
method: "GET",
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}
const payload = await response.json();
console.log(payload);
import axios from "axios";
const client = axios.create({
baseURL: "https://www.scrapestorm.net",
timeout: 30000,
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
const params = {
query: "technology",
};
// Optional parameters
// params.cursor = "QVFIUmVhZF9jdXJzb3I=";
// params.tag = "top";
const { data: payload } = await client.request({
method: "GET",
url: endpoint,
params,
});
console.log(payload);
<?php
declare(strict_types=1);
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
$client = new Client([
'base_uri' => "https://www.scrapestorm.net",
'timeout' => 30.0,
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => "00000000-0000-4000-8000-000000000000",
],
]);
$query = [
"query" => "technology",
];
// Optional parameters
// $query["cursor"] = "QVFIUmVhZF9jdXJzb3I=";
// $query["tag"] = "top";
try {
$response = $client->request("GET", "/api/v1/threads.net/search/posts-by-query", [
'query' => $query,
]);
$payload = json_decode(
(string) $response->getBody(),
true,
512,
JSON_THROW_ON_ERROR
);
var_dump($payload);
} catch (GuzzleException $e) {
throw $e;
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"time"
)
func main() {
baseURL := "https://www.scrapestorm.net"
endpoint := "/api/v1/threads.net/search/posts-by-query"
params := url.Values{}
params.Set("query", "technology")
// Optional parameters
// params.Set("tag", "top")
req, err := http.NewRequest(
"GET",
fmt.Sprintf("%s%s?%s", baseURL, endpoint, params.Encode()),
nil,
)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("X-API-Key", "00000000-0000-4000-8000-000000000000")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var payload any
if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil {
panic(err)
}
fmt.Printf("%+v\n", payload)
}
プレビューには主要なフィールドとコレクションの最初の要素が含まれているため、レスポンスの形をすばやく確認できます。バージョンを切り替えると JSON の形式が変わります。
このコンパクトな JSON の例は、V2 の直近の成功した検証実行から取得したものです。
{
"success": true,
"status": "ok",
"pagination": {
"cursor": null,
"has_more": false
},
"search_context": {
"query": "instagram"
},
"data": {
"count": 12,
"items": [
{
"owner": {
"user_id": "63063870577",
"username": "gloria.leticia.h",
"name": "Gloria Hernandez",
"is_verified": true,
"avatar_url": null
},
"media_id": "3965171886464598946_63063870577",
"created_at": "2026-08-16T18:35:45Z",
"type": "carousel",
"media_type": 8,
"shortcode": "DcHHtKGFoOi",
"caption": "#gymrat #gym #instagram #nutrition",
"hashtags": [
"gymrat",
"gym",
{
"_more_items": 2
}
],
"emails": [],
"is_reply": false,
"is_sponsored": null,
"sponsored_detection_source": null,
"sponsored_detection_confidence": null,
"is_post_unavailable": false,
"engagement": {
"likes_count": null,
"comment_count": 0,
"repost_count": 0,
"quote_count": 0,
"reshare_count": null,
"view_count": null
},
"assets": [
{
"id": "3965171854311047614_63063870577",
"type": "image",
"url": "https://instagram.fsjc1-4.fna.fbcdn.net/v/t51.82787-15/776921600_18091909184640922_1695812031741725684_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=100&ig_cache_key=Mzk2NTE3MTg1NDMxMTA0NzY…",
"height": 2880,
"width": 2160,
"accessibility_caption": null
},
{
"id": "3965171854789201035_63063870577",
"type": "image",
"url": "https://instagram.fsjc1-4.fna.fbcdn.net/v/t51.82787-15/775127293_18091909175640922_7524095910178138651_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&ig_cache_key=Mzk2NTE3MTg1NDc4OTIwMTA…",
"height": 2880,
"width": 2160,
"accessibility_caption": null
},
{
"_more_items": 1
}
]
},
{
"owner": {
"user_id": "80617311775",
"username": "nahthing__here",
"name": "xun",
"is_verified": false,
"avatar_url": null
},
"media_id": "3965170303198502927_80617311775",
"created_at": "2026-08-16T18:32:36Z",
"type": "carousel",
"media_type": 8,
"shortcode": "DcHHWHkEyAP",
"caption": "可能我有奶蛙的靈魂吧 Instagram 看透我了",
"hashtags": [],
"emails": [],
"is_reply": false,
"is_sponsored": null,
"sponsored_detection_source": null,
"sponsored_detection_confidence": null,
"is_post_unavailable": false,
"engagement": {
"likes_count": null,
"comment_count": 0,
"repost_count": 0,
"quote_count": 0,
"reshare_count": null,
"view_count": null
},
"assets": [
{
"id": "3965170282566485435_80617311775",
"type": "image",
"url": "https://instagram.fsjc1-4.fna.fbcdn.net/v/t51.82787-15/776658704_17876910123687776_6206782831729243907_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=111&ig_cache_key=Mzk2NTE3MDI4MjU2NjQ4NTQ…",
"height": 2160,
"width": 1168,
"accessibility_caption": null
},
{
"id": "3965170282859942338_80617311775",
"type": "image",
"url": "https://instagram.fsjc1-4.fna.fbcdn.net/v/t51.82787-15/776077283_17876910132687776_5302136133233187847_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=100&ig_cache_key=Mzk2NTE3MDI4Mjg1OTk0MjM…",
"height": 847,
"width": 851,
"accessibility_caption": null
}
]
},
{
"_more_items": 10
}
]
}
}
このコンパクトな JSON の例は、V1 の直近の成功した検証実行から取得したものです。
{
"success": true,
"status": "ok",
"pagination": {
"cursor": null,
"has_more": false
},
"search_context": {
"query": "instagram"
},
"data": {
"data": {
"searchResults": {
"inform_module": null,
"edges": [
{
"node": {
"thread": "…",
"__typename": "XDTSearchThread"
},
"cursor": ""
},
{
"node": {
"thread": "…",
"__typename": "XDTSearchThread"
},
"cursor": ""
},
{
"_more_items": 10
}
],
"page_info": {
"end_cursor": null,
"has_next_page": false,
"has_previous_page": false,
"start_cursor": null
}
}
},
"extensions": {
"is_final": true,
"server_metadata": {
"request_start_time_ms": 1786905454301,
"time_at_flush_ms": 1786905456419
}
},
"status": "ok"
}
}
このドキュメントを最初の判断材料とし、継続的な利用のためにエンドポイントを接続する前に、料金、プラットフォームのカバー範囲、連携ルールを確認してください。
これらの回答を参考に、この API メソッドがワークフロー、バージョンの選択、導入計画に合うかどうかを判断してください。
このメソッドは 検索 に対して「検索クエリによる投稿」を実行します。以下のコンパクトなレスポンス例で、フィールドの正確な構造を確認できます。
新しい連携では、正規化された構造を提供する V2 を選んでください。V1 は、既にプラットフォーム固有の形式を処理しているクライアントとの互換性のためにのみ使用してください。
API キーを作成し、リクエストヘッダーで送信し、表の必須パラメーターを指定してください。コード例には、正しいパスとリクエスト構造が既に含まれています。