---
title: "Facebook Post Search API (V1)"
description: "Searches public Facebook posts by keyword with optional inclusive date-range filters and cursor pagination. Use it to find topic-related posts or continue a time-bounded public-content search."
aiUsagePrompt: true
---

# Facebook Post Search API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/facebook/search-post/v1\"")'
  :summary='JSON.parse("\"Post Search (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/facebook/post-search-v1-en.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"User security token for API access authentication.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"keyword\",\"in\":\"query\",\"description\":\"Keyword to search for in public posts. Supports basic text matching.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"startDate\",\"in\":\"query\",\"description\":\"Start date for the search range (inclusive), formatted as yyyy-MM-dd.\",\"required\":false,\"schema\":{\"type\":\"string\",\"format\":\"date\"}},{\"name\":\"endDate\",\"in\":\"query\",\"description\":\"End date for the search range (inclusive), formatted as yyyy-MM-dd.\",\"required\":false,\"schema\":{\"type\":\"string\",\"format\":\"date\"}},{\"name\":\"cursor\",\"in\":\"query\",\"description\":\"Pagination cursor for fetching the next set of results.\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"A page of public Facebook posts and its pagination cursor. Date-filtered searches can return posts outside the selected range. Check each post’s timestamp when you need strict date boundaries.\",\"properties\":{\"cursor\":{\"type\":\"string\",\"description\":\"Pagination cursor for continuing the search. Pass the returned string unchanged with the same search parameters.\"},\"results\":{\"type\":\"array\",\"description\":\"Public posts returned on the current search page.\",\"items\":{\"type\":\"object\",\"description\":\"One public Facebook post in the search results.\",\"properties\":{\"post_id\":{\"type\":\"string\",\"description\":\"Facebook post ID, returned as a string.\"},\"type\":{\"type\":\"string\",\"description\":\"Type label reported for the search result.\"},\"url\":{\"type\":\"string\",\"description\":\"Link to the Facebook post.\"},\"message\":{\"type\":[\"string\",\"null\"],\"description\":\"Text of the post, when available.\"},\"message_rich\":{\"type\":[\"string\",\"null\"],\"description\":\"Alternative text representation of the post message, when provided.\"},\"timestamp\":{\"type\":\"integer\",\"description\":\"Post publication time as Unix seconds.\"},\"was_detected_as_ai_generated\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Whether the post carries an AI-generated-content detection flag, when reported.\"},\"was_self_disclosed_as_ai_generated\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Whether the post carries a self-disclosure that it was AI-generated, when reported.\"},\"comments_count\":{\"type\":\"integer\",\"description\":\"Reported comment count for the post.\"},\"reactions_count\":{\"type\":\"integer\",\"description\":\"Reported total reaction count for the post.\"},\"reshare_count\":{\"type\":\"integer\",\"description\":\"Reported reshare count for the post.\"},\"reactions\":{\"type\":\"object\",\"description\":\"Reported counts for individual Facebook reaction types.\",\"properties\":{\"like\":{\"type\":\"integer\",\"description\":\"Count of Like reactions.\"},\"love\":{\"type\":\"integer\",\"description\":\"Count of Love reactions.\"},\"care\":{\"type\":\"integer\",\"description\":\"Count of Care reactions.\"},\"haha\":{\"type\":\"integer\",\"description\":\"Count of Haha reactions.\"},\"wow\":{\"type\":\"integer\",\"description\":\"Count of Wow reactions.\"},\"sad\":{\"type\":\"integer\",\"description\":\"Count of Sad reactions.\"},\"angry\":{\"type\":\"integer\",\"description\":\"Count of Angry reactions.\"}}},\"author\":{\"type\":\"object\",\"description\":\"Author included with the post.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Facebook author ID, returned as a string.\"},\"name\":{\"type\":\"string\",\"description\":\"Display name of the author.\"},\"url\":{\"type\":\"string\",\"description\":\"Link to the Facebook profile or page for the author.\"},\"profile_picture_url\":{\"type\":\"string\",\"description\":\"Image URL for the author’s profile picture.\"}}},\"authors\":{\"type\":\"array\",\"description\":\"List of authors reported for the post.\",\"items\":{\"type\":\"object\",\"description\":\"One reported post author.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Facebook author ID, returned as a string.\"},\"name\":{\"type\":\"string\",\"description\":\"Display name of the author.\"},\"url\":{\"type\":\"string\",\"description\":\"Link to the Facebook profile or page for the author.\"},\"profile_picture_url\":{\"type\":\"string\",\"description\":\"Image URL for the author’s profile picture.\"}}}},\"image\":{\"type\":[\"object\",\"null\"],\"description\":\"Image attached to the post, when available.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Facebook image ID, returned as a string.\"},\"uri\":{\"type\":\"string\",\"description\":\"Image file URL.\"},\"width\":{\"type\":\"integer\",\"description\":\"Reported image width in pixels.\"},\"height\":{\"type\":\"integer\",\"description\":\"Reported image height in pixels.\"}}},\"images_count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Image count reported for the post, when available.\"},\"album_preview\":{\"type\":[\"array\",\"null\"],\"description\":\"Preview entries for the photo album attached to the post, when provided.\",\"items\":{\"type\":\"object\",\"description\":\"One photo album preview entry.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"ID of the media item in the preview, returned as a string.\"},\"type\":{\"type\":\"string\",\"description\":\"Media type label of the album preview entry.\"},\"image_file_uri\":{\"type\":\"string\",\"description\":\"Image file URL for this album preview entry.\"},\"url\":{\"type\":\"string\",\"description\":\"Facebook link associated with this album preview entry.\"}}}},\"video\":{\"type\":[\"string\",\"null\"],\"description\":\"Facebook link to a video attached to the post, when available.\"},\"video_files\":{\"type\":[\"object\",\"null\"],\"description\":\"Returned video file links, when available.\",\"properties\":{\"video_sd_file\":{\"type\":\"string\",\"description\":\"URL of the standard-definition video file.\"},\"video_hd_file\":{\"type\":\"string\",\"description\":\"URL of the high-definition video file.\"}}},\"video_thumbnail\":{\"type\":[\"string\",\"null\"],\"description\":\"URL of the video thumbnail, when available.\"},\"external_url\":{\"type\":[\"string\",\"null\"],\"description\":\"External webpage linked from the post, when provided.\"},\"attached_post\":{\"type\":[\"object\",\"null\"],\"description\":\"Another Facebook post attached to this result, when provided.\",\"properties\":{\"post_id\":{\"type\":\"string\",\"description\":\"Facebook ID of the attached post, returned as a string.\"},\"url\":{\"type\":\"string\",\"description\":\"Facebook link for the attached post.\"},\"message\":{\"type\":\"string\",\"description\":\"Text of the attached post.\"},\"author\":{\"type\":\"object\",\"description\":\"Author of the attached post.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Facebook author ID, returned as a string.\"},\"name\":{\"type\":\"string\",\"description\":\"Display name of the author.\"},\"url\":{\"type\":\"string\",\"description\":\"Link to the Facebook profile or page for the author.\"}}},\"photo_url\":{\"type\":[\"string\",\"null\"],\"description\":\"Image URL provided with the attached post, when available.\"},\"video_url\":{\"type\":[\"string\",\"null\"],\"description\":\"Video URL provided with the attached post, when available.\"}}},\"attached_post_url\":{\"type\":[\"string\",\"null\"],\"description\":\"Link to the attached Facebook post, when provided.\"},\"associated_group_id\":{\"type\":[\"string\",\"null\"],\"description\":\"ID of the Facebook group associated with the post, when available.\"},\"associated_group\":{\"type\":[\"object\",\"null\"],\"description\":\"Details of the Facebook group associated with the post, when available.\",\"properties\":{\"group_id\":{\"type\":\"string\",\"description\":\"Facebook group ID, returned as a string.\"},\"name\":{\"type\":\"string\",\"description\":\"Display name of the Facebook group.\"},\"url\":{\"type\":\"string\",\"description\":\"Link to the Facebook group.\"}}}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Invalid request parameters or body\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Invalid or inactive access token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Permission denied\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Request rate or daily quota limit exceeded\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Internal server error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Service temporarily unavailable\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"Global production API (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/facebook/search-post/v1\"")' />

<p>Searches public Facebook posts by keyword with optional inclusive date-range filters and cursor pagination. Use it to find topic-related posts or continue a time-bounded public-content search.</p>

## Parameters

<div class="api-doc-table api-doc-table--params">

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Yes | - | User security token for API access authentication. |
| <code>keyword</code> | query | <code>string</code> | Yes | - | Keyword to search for in public posts. Supports basic text matching. |
| <code>startDate</code> | query | <code>string</code> | No | - | Start date for the search range (inclusive), formatted as yyyy-MM-dd. |
| <code>endDate</code> | query | <code>string</code> | No | - | End date for the search range (inclusive), formatted as yyyy-MM-dd. |
| <code>cursor</code> | query | <code>string</code> | No | <code></code> | Pagination cursor for fetching the next set of results. |

</div>

## Code Samples

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE'
```

```text [🤖 AI Prompt]
I want to use the "Post Search (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/facebook/post-search-v1-en.json

Parameters:
- token (query): User security token for API access authentication. (Required)
- keyword (query): Keyword to search for in public posts. Supports basic text matching. (Required)
- startDate (query): Start date for the search range (inclusive), formatted as yyyy-MM-dd.
- endDate (query): End date for the search range (inclusive), formatted as yyyy-MM-dd.
- cursor (query): Pagination cursor for fetching the next set of results.

Return format: safely handle JSON or text according to the actual Content-Type.

Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
   - 0: Success
   - 100: Invalid or Inactive Token
   - 301: Collection Failed. Please Retry.
   - 302: Rate Limit Exceeded
   - 303: Daily Quota Exceeded
   - 400: Invalid Parameters
   - 500: Internal Server Error
   - 600: Permission Denied
   - 601: Insufficient Balance
   - 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.

Please help me write a script in my preferred programming language to call this API and handle the response.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
        final String url = BASE_URL + "/api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/facebook/search-post/v1?token=YOUR_API_KEY&keyword=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/facebook/post-search-v1-en.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI Definition (JSON)]</a>
</div>

## Response Fields

Key fields in a successful response (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Field path | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | A page of public Facebook posts and its pagination cursor. Date-filtered searches can return posts outside the selected range. Check each post’s timestamp when you need strict date boundaries. |
| <code>data.cursor</code> | <code>string</code> | Pagination cursor for continuing the search. Pass the returned string unchanged with the same search parameters. |
| <code>data.results</code> | <code>array</code> | Public posts returned on the current search page. |
| <code>data.results[]</code> | <code>object</code> | One public Facebook post in the search results. |
| <code>data.results[].post_id</code> | <code>string</code> | Facebook post ID, returned as a string. |
| <code>data.results[].type</code> | <code>string</code> | Type label reported for the search result. |
| <code>data.results[].url</code> | <code>string</code> | Link to the Facebook post. |
| <code>data.results[].message</code> | <code>string &#124; null</code> | Text of the post, when available. |
| <code>data.results[].message_rich</code> | <code>string &#124; null</code> | Alternative text representation of the post message, when provided. |
| <code>data.results[].timestamp</code> | <code>integer</code> | Post publication time as Unix seconds. |
| <code>data.results[].was_detected_as_ai_generated</code> | <code>boolean &#124; null</code> | Whether the post carries an AI-generated-content detection flag, when reported. |
| <code>data.results[].was_self_disclosed_as_ai_generated</code> | <code>boolean &#124; null</code> | Whether the post carries a self-disclosure that it was AI-generated, when reported. |
| <code>data.results[].comments_count</code> | <code>integer</code> | Reported comment count for the post. |
| <code>data.results[].reactions_count</code> | <code>integer</code> | Reported total reaction count for the post. |
| <code>data.results[].reshare_count</code> | <code>integer</code> | Reported reshare count for the post. |
| <code>data.results[].reactions</code> | <code>object</code> | Reported counts for individual Facebook reaction types. |
| <code>data.results[].reactions.like</code> | <code>integer</code> | Count of Like reactions. |
| <code>data.results[].reactions.love</code> | <code>integer</code> | Count of Love reactions. |
| <code>data.results[].reactions.care</code> | <code>integer</code> | Count of Care reactions. |
| <code>data.results[].reactions.haha</code> | <code>integer</code> | Count of Haha reactions. |
| <code>data.results[].reactions.wow</code> | <code>integer</code> | Count of Wow reactions. |
| <code>data.results[].reactions.sad</code> | <code>integer</code> | Count of Sad reactions. |
| <code>data.results[].reactions.angry</code> | <code>integer</code> | Count of Angry reactions. |
| <code>data.results[].author</code> | <code>object</code> | Author included with the post. |
| <code>data.results[].author.id</code> | <code>string</code> | Facebook author ID, returned as a string. |
| <code>data.results[].author.name</code> | <code>string</code> | Display name of the author. |
| <code>data.results[].author.url</code> | <code>string</code> | Link to the Facebook profile or page for the author. |
| <code>data.results[].author.profile_picture_url</code> | <code>string</code> | Image URL for the author’s profile picture. |
| <code>data.results[].authors</code> | <code>array</code> | List of authors reported for the post. |
| <code>data.results[].authors[]</code> | <code>object</code> | One reported post author. |
| <code>data.results[].authors[].id</code> | <code>string</code> | Facebook author ID, returned as a string. |
| <code>data.results[].authors[].name</code> | <code>string</code> | Display name of the author. |
| <code>data.results[].authors[].url</code> | <code>string</code> | Link to the Facebook profile or page for the author. |
| <code>data.results[].authors[].profile_picture_url</code> | <code>string</code> | Image URL for the author’s profile picture. |
| <code>data.results[].image</code> | <code>object &#124; null</code> | Image attached to the post, when available. |
| <code>data.results[].image.id</code> | <code>string</code> | Facebook image ID, returned as a string. |
| <code>data.results[].image.uri</code> | <code>string</code> | Image file URL. |
| <code>data.results[].image.width</code> | <code>integer</code> | Reported image width in pixels. |
| <code>data.results[].image.height</code> | <code>integer</code> | Reported image height in pixels. |
| <code>data.results[].images_count</code> | <code>integer &#124; null</code> | Image count reported for the post, when available. |
| <code>data.results[].album_preview</code> | <code>array &#124; null</code> | Preview entries for the photo album attached to the post, when provided. |
| <code>data.results[].album_preview[]</code> | <code>object</code> | One photo album preview entry. |
| <code>data.results[].album_preview[].id</code> | <code>string</code> | ID of the media item in the preview, returned as a string. |
| <code>data.results[].album_preview[].type</code> | <code>string</code> | Media type label of the album preview entry. |
| <code>data.results[].album_preview[].image_file_uri</code> | <code>string</code> | Image file URL for this album preview entry. |
| <code>data.results[].album_preview[].url</code> | <code>string</code> | Facebook link associated with this album preview entry. |
| <code>data.results[].video</code> | <code>string &#124; null</code> | Facebook link to a video attached to the post, when available. |
| <code>data.results[].video_files</code> | <code>object &#124; null</code> | Returned video file links, when available. |
| <code>data.results[].video_files.video_sd_file</code> | <code>string</code> | URL of the standard-definition video file. |
| <code>data.results[].video_files.video_hd_file</code> | <code>string</code> | URL of the high-definition video file. |
| <code>data.results[].video_thumbnail</code> | <code>string &#124; null</code> | URL of the video thumbnail, when available. |
| <code>data.results[].external_url</code> | <code>string &#124; null</code> | External webpage linked from the post, when provided. |
| <code>data.results[].attached_post</code> | <code>object &#124; null</code> | Another Facebook post attached to this result, when provided. |
| <code>data.results[].attached_post.post_id</code> | <code>string</code> | Facebook ID of the attached post, returned as a string. |
| <code>data.results[].attached_post.url</code> | <code>string</code> | Facebook link for the attached post. |
| <code>data.results[].attached_post.message</code> | <code>string</code> | Text of the attached post. |
| <code>data.results[].attached_post.author</code> | <code>object</code> | Author of the attached post. |
| <code>data.results[].attached_post.author.id</code> | <code>string</code> | Facebook author ID, returned as a string. |
| <code>data.results[].attached_post.author.name</code> | <code>string</code> | Display name of the author. |
| <code>data.results[].attached_post.author.url</code> | <code>string</code> | Link to the Facebook profile or page for the author. |
| <code>data.results[].attached_post.photo_url</code> | <code>string &#124; null</code> | Image URL provided with the attached post, when available. |
| <code>data.results[].attached_post.video_url</code> | <code>string &#124; null</code> | Video URL provided with the attached post, when available. |
| <code>data.results[].attached_post_url</code> | <code>string &#124; null</code> | Link to the attached Facebook post, when provided. |
| <code>data.results[].associated_group_id</code> | <code>string &#124; null</code> | ID of the Facebook group associated with the post, when available. |
| <code>data.results[].associated_group</code> | <code>object &#124; null</code> | Details of the Facebook group associated with the post, when available. |
| <code>data.results[].associated_group.group_id</code> | <code>string</code> | Facebook group ID, returned as a string. |
| <code>data.results[].associated_group.name</code> | <code>string</code> | Display name of the Facebook group. |
| <code>data.results[].associated_group.url</code> | <code>string</code> | Link to the Facebook group. |

</div>

## Response Example

<ApiExampleSection :api='JSON.parse("\"/api/facebook/search-post/v1\"")' />

