2020-01-01 22:37:59 +01:00
---
2022-11-20 07:34:38 +01:00
title: Search
2020-01-01 22:37:59 +01:00
description: Represents the results of a search.
menu:
docs:
parent: entities
2022-11-20 07:34:38 +01:00
aliases: [
"/entities/results",
"/entities/Results",
"/entities/search",
"/entities/Search",
"/api/entities/results",
"/api/entities/Results",
"/api/entities/search",
"/api/entities/Search",
]
2020-01-01 22:37:59 +01:00
---
## Example
2022-11-20 07:34:38 +01:00
Truncated sample search for q=cats limit=2
```json
2020-01-01 22:37:59 +01:00
{
"accounts": [
{
"id": "180744",
"username": "catstar",
"acct": "catstar@catgram.jp",
"display_name": "catstar",
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
},
{
"id": "214293",
"username": "catsareweird",
"acct": "catsareweird",
"display_name": "Cats Are Weird",
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
}
],
"statuses": [
{
"id": "103085519055545958",
"created_at": "2019-11-05T13:23:09.000Z",
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
"content": "< p > cats< br > cats never change< / p > ",
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
},
{
"id": "101068121469614510",
"created_at": "2018-11-14T06:31:48.000Z",
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
"spoiler_text": "Cats",
2022-11-20 07:34:38 +01:00
// ...
2020-01-12 14:11:56 +01:00
"content": "< p > Cats are inherently good at self-care. </ p >< p >< a href = \"https://mspsocial.net/tags/cats \" class = \"mention hashtag \" rel = \"nofollow noopener noreferrer \" target = \"_blank \"> #< span > cats< /span}</ p > ",
2022-11-20 07:34:38 +01:00
// ...
},
// ...
2020-01-01 22:37:59 +01:00
],
"hashtags": [
{
"name": "cats",
"url": "https://mastodon.social/tags/cats",
"history": [
{
"day": "1574553600",
"uses": "10",
"accounts": "9"
},
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
]
},
{
"name": "catsofmastodon",
"url": "https://mastodon.social/tags/catsofmastodon",
"history": [
{
"day": "1574553600",
"uses": "6",
"accounts": "5"
},
2022-11-20 07:34:38 +01:00
// ...
2020-01-01 22:37:59 +01:00
]
}
]
}
```
2022-11-20 07:34:38 +01:00
## Attributes
2020-01-01 22:37:59 +01:00
2020-01-12 14:11:56 +01:00
### `accounts` {#accounts}
2020-01-01 22:37:59 +01:00
2020-01-12 14:11:56 +01:00
**Description:** Accounts which match the given query\
2022-11-20 07:34:38 +01:00
**Type:** Array of [Account ]({{< relref "entities/Account" >}} )\
2022-12-14 22:55:30 +01:00
**Version history:**\
1.1.0 - added
2020-01-01 22:37:59 +01:00
2020-01-12 14:11:56 +01:00
### `statuses` {#statuses}
2020-01-01 22:37:59 +01:00
2020-01-12 14:11:56 +01:00
**Description:** Statuses which match the given query\
2022-11-20 07:34:38 +01:00
**Type:** Array of [Status ]({{< relref "entities/Status" >}} )\
2022-12-14 22:55:30 +01:00
**Version history:**\
1.1.0 - added
2020-01-01 22:37:59 +01:00
2020-01-12 14:11:56 +01:00
### `hashtags` {#hashtags}
2020-01-01 22:37:59 +01:00
2020-01-12 14:11:56 +01:00
**Description:** Hashtags which match the given query\
2022-11-20 07:34:38 +01:00
**Type:** Array of [Tag ]({{< relref "entities/Tag" >}} )\
**Version history:**\
1.1.0 - added\
2022-12-14 22:55:30 +01:00
2.4.1 - v1/search deprecated because it returns Array of String. v2/search added which returns Array of Tag.\
2022-11-20 07:34:38 +01:00
3.0.0 - v1 removed
2020-01-01 22:37:59 +01:00
## See also
2022-11-20 07:34:38 +01:00
{{< page-relref ref = "methods/search" caption = "search API methods" > }}
2020-01-01 22:37:59 +01:00
2022-11-20 07:34:38 +01:00
{{< caption-link url = "https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/search_serializer.rb" caption = "app/serializers/rest/search_serializer.rb" > }}
2020-01-01 22:37:59 +01:00