1
0
mirror of https://github.com/mastodon/documentation synced 2025-04-11 22:56:17 +02:00
trwnh ffbe66a389
Update content for 4.0, part 2 (#1060)
* fix relrefs around trends and related entities

* revert moving caption-links to middle of page

* hide empty menu in table of contents

* clarify edit notifs are only for boosted statuses

* following/followers no longer need auth

* fix typo

* specify cooldown period for account Move

* use the correct cooldown

* add missing parameters to accounts/id/statuses

* link to account_statuses_filter.rb

* fix typo (#1072)

* fix typo (#1073)

* fix link to http sig spec (#1067)

* simply HTTP request examples in api methods docs

* add missing client_secret to oauth/token (#1062)

* Add any, all, none to hashtag timeline

* minor formatting changes

* Update signature requirements and advice

* fix public key -> private key

* clarify use of RSA with SHA256

* Add note about saving your profile after adding rel-me link

* v2 filters api

* comment out params that shouldn't be used in v2 filter api

* admin trends

* remove old todo

* canonical email blocks + scheduled statuses

* remove under-construction warnings from finished pages

* verify api method params with source code

* fix typo (#1088)

* fix broken caption-links (#1100)

* fix formatting of entities (#1094)

* Remove keybase section from user guide (#1093)

* fix typos (#1092)

* Verify limits are accurate (#1086)

* add mention of iframe limitation (#1084)

* Add CORS header to WEB_DOMAIN example (#1083)

* Fix typo (#1081)

* pin http sigs spec at draft 8

* Revert "pin http sigs spec at draft 8"

This reverts commit 9fd5f7032b69b29e77599dd62adfe8d2f5cd4f20.

* add case sensitivity warning to 4.0 roles

* Add url length note to bio (#1087)

* remove follow scope from examples (#1103)

* clarify usage of update_credentials to update profile fields

* add noindex to Account entitity

* remove required hint from technically not required property
2022-12-14 22:55:30 +01:00

227 lines
5.2 KiB
Markdown

---
title: trends API methods
description: View hashtags that are currently being used more frequently than usual.
menu:
docs:
weight: 10
name: trends
parent: methods-instance
identifier: methods-trends
aliases: [
"/methods/trends",
"/api/methods/trends",
"/methods/instance/trends",
]
---
<style>
#TableOfContents ul ul ul {display: none}
</style>
## View trending tags {#tags}
```http
GET /api/v1/trends/tags HTTP/1.1
```
Tags that are being used more frequently within the past week.
**Returns:** Array of [Tag]({{< relref "entities/Tag" >}})\
**OAuth:** Public\
**Version history:**\
3.0.0 - added\
3.5.0 - method signature changed from `GET /api/v1/trends` to `GET /api/v1/trends/tags`. The former is a deprecated alias that may be removed in the future.
#### Request
##### Query parameters
limit
: Integer. Maximum number of results to return. Defaults to 10 tags. Max 20 tags.
offset
: Integer. Skip the first n results.
#### Response
##### 200: OK
```json
[
{
"name": "hola",
"url": "https://mastodon.social/tags/hola",
"history": [
{
"day": "1574726400",
"uses": "13",
"accounts": "10"
},
// ...
]
},
{
"name": "SaveDotOrg",
"url": "https://mastodon.social/tags/SaveDotOrg",
"history": [
{
"day": "1574726400",
"uses": "9",
"accounts": "9"
},
// ...
]
},
{
"name": "introduction",
"url": "https://mastodon.social/tags/introduction",
"history": [
{
"day": "1574726400",
"uses": "15",
"accounts": "14"
},
// ...
]
},
// ...
]
```
---
## View trending statuses {#statuses}
```http
GET /api/v1/trends/statuses HTTP/1.1
```
Statuses that have been interacted with more than others.
**Returns:** Array of [Status]({{< relref "entities/Status" >}})\
**OAuth:** Public\
**Version history:**\
3.5.0 - added
#### Request
##### Query parameters
limit
: Integer. Maximum number of results to return. Defaults to 20 statuses. Max 40 statuses.
offset
: Integer. Skip the first n results.
#### Response
##### 200: OK
```json
[
{
"id": "108910940413327534",
"created_at": "2022-08-30T08:44:26.366Z",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"sensitive": false,
// ...
"content": "<p>In order to prevent such incidents from happening in the future, we are implementing a fixed set of internal guidelines which must be met before any media content can be shared on our social media platforms. The distribution of material which promotes a message of racism or sexism is unacceptable. We can do better and in the future we will do better.</p><p>We apologize again for this incident and can assure you that it will not happen again.</p><p>Your Tutanota Team</p>",
// ...
},
// ...
]
```
---
## View trending links {#links}
```http
GET /api/v1/trends/links HTTP/1.1
```
Links that have been shared more than others.
**Returns:** Array of [Trends::Link]({{< relref "entities/PreviewCard#trends-link" >}})\
**OAuth:** Public\
**Version history:**\
3.5.0 - added
#### Request
##### Query parameters
limit
: Integer. Maximum number of results to return. Defaults to 10 links. Max 20 links.
offset
: Integer. Skip the first n results.
#### Response
##### 200: OK
```json
[
{
"url": "https://www.nbcnews.com/specials/plan-your-vote-2022-elections/index.html",
"title": "Plan Your Vote: 2022 Elections",
"description": "Everything you need to know about the voting rules where you live, including registration, mail-in voting, changes since 2020, and more.",
"type": "link",
"author_name": "NBC News",
"author_url": "",
"provider_name": "NBC News",
"provider_url": "",
"html": "",
"width": 400,
"height": 225,
"image": "https://files.mastodon.social/cache/preview_cards/images/045/027/478/original/0783d5e91a14fd49.jpeg",
"embed_url": "",
"blurhash": "UcQmF#ay~qofj[WBj[j[~qof9Fayofofayay",
"history": [
{
"day": "1661817600",
"accounts": "7",
"uses": "7"
},
{
"day": "1661731200",
"accounts": "23",
"uses": "23"
},
{
"day": "1661644800",
"accounts": "0",
"uses": "0"
},
{
"day": "1661558400",
"accounts": "0",
"uses": "0"
},
{
"day": "1661472000",
"accounts": "0",
"uses": "0"
},
{
"day": "1661385600",
"accounts": "0",
"uses": "0"
},
{
"day": "1661299200",
"accounts": "0",
"uses": "0"
}
]
},
// ...
]
```
---
## See also
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/trends/links_controller.rb" caption="app/controllers/api/v1/trends/links_controller.rb" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/trends/statuses_controller.rb" caption="app/controllers/api/v1/trends/statuses_controller.rb" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/trends/tags_controller.rb" caption="app/controllers/api/v1/trends/tags_controller.rb" >}}