Skip to content
cyperdark edited this page May 23, 2023 · 1 revision

Returns a list of news posts and related metadata

Authentication

const { auth } = require('osu-api-extended');
await auth.login(client_id, client_secret);

Function

await v2.site.news.list(object)

Parameters

Parameter Type Description
object.limit number Maximum number of posts (12 default, 1 minimum, 21 maximum)
object.year number Year to return posts from
object.cursorPublished string Pagination cursorPublished
object.cursorId number Pagination cursorId

Response

export interface response {
  news_posts: {
    id: number;
    author: string;
    edit_url: string;
    first_image: string;
    published_at: string;
    updated_at: string;
    slug: string;
    title: string;
    preview: string;
  }[];
  news_sidebar: {
    current_year: number;
    news_posts: {
      id: number;
      author: string;
      edit_url: string;
      first_image: string;
      published_at: string;
      updated_at: string;
      slug: string;
      title: string;
    }[];
    years: number[];
  };
  search: {
    limit: number;
    sort: string;
    year: string;
  };
  cursor: {
    published_at: string;
    id: number;
  };
  cursor_string: string;
}

[v3.x.x] Documentation


[v2.x.x] Documentation

Clone this wiki locally