# Search Posts API

## Overview

The Search Posts API allows you to search and sort relevant posts created in social.plus. This API returns a sorted list of post objects that contain the relevant content.

### API Endpoint

{% openapi src="/files/WAZrgN8t1OldhUBssyj0" path="/search/posts" method="get" %}
[2024-06-25\_searchPostAPI (1).yml](https://2352509137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX0mOAVWkotGme0iRzu%2Fuploads%2F94AUtTklLMVfr8oX26jo%2F2024-06-25_searchPostAPI%20\(1\).yml?alt=media\&token=1a4888cd-7855-4c72-bfe4-4e001422ca68)
{% endopenapi %}

{% hint style="info" %}
Example Curl
{% endhint %}

```

curl --location 'https://beta.amity.services/api/v3/search/posts?query=Amity&targetType=community&types[]=image&postedUserId=userId' \
--header 'Authorization: Bearer {access_token}'

```

{% hint style="info" %}
`Query Params Details`
{% endhint %}

**targetType** can be the following values:

* **community**: Search posts in all communities specified in `targetIds`.
* **user**: Search all posts on the user feed specified in `targetIds`.
* `targetIds` limited to 100 Ids per search.

**filter** can be the following values:

* **all**: Search posts in all public communities
* **member**: Search posts in all communities that the user has joined
* **notMember**: Search posts in all public communities that the user has not joined

{% hint style="danger" %}
**Limitations**
{% endhint %}

* Currently, searching within a post’s metadata is not supported.
* Posts created on a user feed within a network that has privacy enabled are not yet searchable.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.social.plus/developers/beta-features/search-posts-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
