Mastodon
  • What is Mastodon?
  • Using Mastodon
    • Signing up for an account
    • Setting up your profile
    • Posting to your profile
    • Using the network features
    • Dealing with unwanted content
    • Promoting yourself and others
    • Set your preferences
    • More settings
    • Using Mastodon externally
    • Moving or leaving accounts
    • Running your own server
  • Running Mastodon
    • Preparing your machine
    • Installing from source
    • Configuring your environment
    • Configuring full-text search
    • Installing optional features
      • Object storage
      • Onion services
      • Captcha
      • Single Sign On
    • Setting up your new instance
    • Using the admin CLI
    • Upgrading to a new release
    • Backing up your server
    • Migrating to a new machine
    • Scaling up your server
    • Moderation actions
    • Troubleshooting errors
      • Database index corruption
    • Roles
  • Developing Mastodon apps
    • Getting started with the API
    • Playing with public data
    • Obtaining client app access
    • Logging in with an account
    • Libraries and implementations
  • Contributing to Mastodon
    • Technical overview
    • Setting up a dev environment
    • Code structure
    • Routes
    • Bug bounties and responsible disclosure
  • Spec compliance
    • ActivityPub
    • WebFinger
    • Security
    • Microformats
    • OAuth
    • Bearcaps
  • REST API
    • Datetime formats
    • Guidelines and best practices
    • OAuth Tokens
    • OAuth Scopes
    • Rate limits
  • API Methods
    • apps
      • oauth
      • emails
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • followed_tags
      • suggestions
      • tags
    • profile
    • statuses
      • media
      • polls
      • scheduled_statuses
    • timelines
      • conversations
      • lists
      • markers
      • streaming
    • grouped notifications
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
      • announcements
    • admin
      • accounts
      • canonical_email_blocks
      • dimensions
      • domain_allows
      • domain_blocks
      • email_domain_blocks
      • ip_blocks
      • measures
      • reports
      • retention
      • trends
    • proofs
    • oembed
  • API Entities
    • Account
    • AccountWarning
    • Admin::Account
    • Admin::CanonicalEmailBlock
    • Admin::Cohort
    • Admin::Dimension
    • Admin::DomainAllow
    • Admin::DomainBlock
    • Admin::EmailDomainBlock
    • Admin::Ip
    • Admin::IpBlock
    • Admin::Measure
    • Admin::Report
    • Announcement
    • Appeal
    • Application
    • Context
    • Conversation
    • CustomEmoji
    • DomainBlock
    • Error
    • ExtendedDescription
    • FamiliarFollowers
    • FeaturedTag
    • Filter
    • FilterKeyword
    • FilterResult
    • FilterStatus
    • IdentityProof
    • Instance
    • List
    • Marker
    • MediaAttachment
    • Notification
    • NotificationPolicy
    • NotificationRequest
    • Poll
    • Preferences
    • PreviewCard
    • PreviewCardAuthor
    • PrivacyPolicy
    • Quote
    • Reaction
    • Relationship
    • RelationshipSeveranceEvent
    • Report
    • Role
    • Rule
    • ScheduledStatus
    • Search
    • ShallowQuote
    • Status
    • StatusEdit
    • StatusSource
    • Suggestion
    • Tag
    • TermsOfService
    • Token
    • Translation
    • V1::Filter
    • V1::Instance
    • V1::NotificationPolicy
    • WebPushSubscription

admin/trends API methods

TODO

    • View trending links
    • View trending statuses
    • View trending tags
    • See also

View trending links

GET /api/v1/admin/trends/links HTTP/1.1

Links that have been shared more than others, including unapproved and unreviewed links.

Returns: Array of Trends::Link
OAuth: User token + admin:read
Permissions: Manage Taxonomies
Version history:
3.5.0 - added

Request

Headers
Authorization
required Provide this header with Bearer <user_token> to gain authorized access to this API method.

Response

200: OK
[
  {
    "url": "https://twitter.com/arufa_faru/status/1594262272007753728",
    "title": "ARuFa on Twitter",
    "description": "“言葉をマネするぬいぐるみを改造してエレキギターを直接繋いでみました”",
    "type": "link",
    "author_name": "",
    "author_url": "",
    "provider_name": "Twitter",
    "provider_url": "",
    "html": "",
    "width": 400,
    "height": 225,
    "image": "https://media.chitter.xyz/cache/preview_cards/images/002/162/720/original/b5360261e8ce17fc.jpeg",
    "embed_url": "",
    "blurhash": "UNFiDM~o-oD%x[xtaxM|xaNHRkjsoft7ofWB",
    "history": [
      {
        "day": "1669507200",
        "accounts": "9",
        "uses": "9"
      },
      {
        "day": "1669420800",
        "accounts": "0",
        "uses": "0"
      },
      {
        "day": "1669334400",
        "accounts": "0",
        "uses": "0"
      },
      {
        "day": "1669248000",
        "accounts": "0",
        "uses": "0"
      },
      {
        "day": "1669161600",
        "accounts": "0",
        "uses": "0"
      },
      {
        "day": "1669075200",
        "accounts": "0",
        "uses": "0"
      },
      {
        "day": "1668988800",
        "accounts": "0",
        "uses": "0"
      }
    ]
  },
  // ...
]
403: Forbidden

Authorized user is missing a permission, or invalid or missing Authorization header

{
  "error": "This action is not allowed"
}

View trending statuses

GET /api/v1/admin/trends/statuses HTTP/1.1

Statuses that have been interacted with more than others, including unapproved and unreviewed statuses.

Returns: Array of Status
OAuth: User token + admin:read
Permissions: Manage Taxonomies
Version history:
3.5.0 - added

Request

Headers
Authorization
required Provide this header with Bearer <user_token> to gain authorized access to this API method.

Response

200: OK
[
  {
    "id": "109415512969053017",
    "created_at": "2022-11-27T11:23:52.000Z",
    "in_reply_to_id": null,
    "in_reply_to_account_id": null,
    // ...
    "account": {
      "id": "109332240210946752",
      // ...
    },
    "media_attachments": [],
    "mentions": [],
    "tags": [],
    "emojis": [],
    "card": null,
    "poll": null
  },
  // ...
]
403: Forbidden

Authorized user is missing a permission, or invalid or missing Authorization header

{
  "error": "This action is not allowed"
}

View trending tags

GET /api/v1/admin/trends/tags HTTP/1.1

Tags that are being used more frequently within the past week, including unapproved and unreviewed tags.

Returns: Array of Admin::Tag
OAuth: User token + admin:read
Permissions: Manage Taxonomies
Version history:
3.5.0 - added
4.0.0 - Returns an array of Tag due to a bug
4.1.0 - Bug fixed

Request

Headers
Authorization
required Provide this header with Bearer <user_token> to gain authorized access to this API method.

Response

200: OK
[
  {
    "name": "caturday",
    "url": "https://mastodon.example/tags/caturday",
    "history": [
      {
        "day": "1669507200",
        "accounts": "53",
        "uses": "56"
      },
      {
        "day": "1669420800",
        "accounts": "142",
        "uses": "171"
      },
      {
        "day": "1669334400",
        "accounts": "11",
        "uses": "11"
      },
      {
        "day": "1669248000",
        "accounts": "8",
        "uses": "9"
      },
      {
        "day": "1669161600",
        "accounts": "8",
        "uses": "20"
      },
      {
        "day": "1669075200",
        "accounts": "11",
        "uses": "11"
      },
      {
        "day": "1668988800",
        "accounts": "17",
        "uses": "22"
      }
    ],
    "id": "802",
    "trendable": true,
    "usable": true,
    "requires_review": false
  },
]
403: Forbidden

Authorized user is missing a permission, or invalid or missing Authorization header

{
  "error": "This action is not allowed"
}

See also

app/controllers/api/v1/admin/trends/links_controller.rb
app/controllers/api/v1/admin/trends/statuses_controller.rb
app/controllers/api/v1/admin/trends/tags_controller.rb

Last updated October 10, 2024 · Improve this page

Sponsored by

Dotcom-Monitor LoadView Stephen Tures Swayable SponsorMotion

Join Mastodon · Blog ·

View source · CC BY-SA 4.0 · Imprint