# 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="<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>" 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.
