メインコンテンツへスキップ
POST
/
v1
/
searches
Suche erstellen
curl --request POST \
  --url https://api.olostep.com/v1/searches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>"
}
'
{
  "id": "search_9bi0sbj9xa",
  "object": "search",
  "created": 1760327323,
  "metadata": {},
  "query": "Best Answer Engine Optimization startups",
  "result": {
    "json_content": "<string>",
    "json_hosted_url": "<string>",
    "links": [
      {
        "url": "<string>",
        "title": "<string>",
        "description": "<string>"
      }
    ]
  }
}

概要

このエンドポイントを使用して、新しい検索を作成します。検索は、特定の条件に基づいてデータをフィルタリングするために使用されます。

リクエスト

POST /v1/searches エンドポイントにリクエストを送信することで、新しい検索を作成できます。

パラメータ

  • query (必須): 検索クエリを指定します。
  • filters (オプション): 検索結果を絞り込むためのフィルタを指定します。
  • sort (オプション): 検索結果を並べ替えるための基準を指定します。

レスポンス

成功した場合、サーバーは新しく作成された検索の詳細を含む JSON オブジェクトを返します。

レスポンス例

{
  "id": "12345",
  "query": "example query",
  "filters": {
    "status": "active"
  },
  "sort": "created_at"
}

エラー

エラーが発生した場合、適切な HTTP ステータスコードとエラーメッセージが返されます。

一般的なエラー

  • 400 Bad Request: リクエストが無効です。必須パラメータが欠落しているか、形式が正しくありません。
  • 401 Unauthorized: 認証に失敗しました。API キーが無効か、提供されていません。
  • 500 Internal Server Error: サーバー側で問題が発生しました。後でもう一度試してください。

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

ボディ

application/json
query
string
必須

Die Suchabfrage in natürlicher Sprache.

レスポンス

Erfolgreiche Antwort mit Suchergebnissen.

id
string
:

"search_9bi0sbj9xa"

object
string
:

"search"

created
integer
:

1760327323

metadata
object
query
string
:

"Best Answer Engine Optimization startups"

result
object