# Get the top topics filtered by period

`GET /top.json`

Authentication: no security requirement declared for this operation.

Parameters:

- `Api-Key` (header, string, required)
  Type: string

- `Api-Username` (header, string, required)
  Type: string

- `period` (query, string, optional) - Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily`
  Type: string

- `per_page` (query, integer, optional) - Maximum number of topics returned, between 1-100
  Type: integer

Responses:

- 200: response

Content type: application/json

Type: object

- `users` (optional)
  Type: Array<object>
  
  Items:
    Type: object
    
    - `id` (optional)
      Type: integer
    
    - `username` (optional)
      Type: string
    
    - `name` (optional)
      Type: string
    
    - `avatar_template` (optional)
      Type: string

- `primary_groups` (optional)
  Type: Array<any>
  
  Items:
    Type: any

- `topic_list` (optional)
  Type: object
  
  - `can_create_topic` (optional)
    Type: boolean
  
  - `draft` (optional)
    Type: string; nullable
  
  - `draft_key` (optional)
    Type: string
  
  - `draft_sequence` (optional)
    Type: integer
  
  - `for_period` (optional)
    Type: string
  
  - `per_page` (optional)
    Type: integer
  
  - `topics` (optional)
    Type: Array<object>
    
    Items:
      Type: object
      
      - `id` (optional)
        Type: integer
      
      - `title` (optional)
        Type: string
      
      - `fancy_title` (optional)
        Type: string
      
      - `slug` (optional)
        Type: string
      
      - `posts_count` (optional)
        Type: integer
      
      - `reply_count` (optional)
        Type: integer
      
      - `highest_post_number` (optional)
        Type: integer
      
      - `image_url` (optional)
        Type: string; nullable
      
      - `created_at` (optional)
        Type: string
      
      - `last_posted_at` (optional)
        Type: string
      
      - `bumped` (optional)
        Type: boolean
      
      - `bumped_at` (optional)
        Type: string
      
      - `archetype` (optional)
        Type: string
      
      - `unseen` (optional)
        Type: boolean
      
      - `last_read_post_number` (optional)
        Type: integer
      
      - `unread_posts` (optional)
        Type: integer
      
      - `pinned` (optional)
        Type: boolean
      
      - `unpinned` (optional)
        Type: boolean
      
      - `visible` (optional)
        Type: boolean
      
      - `closed` (optional)
        Type: boolean
      
      - `archived` (optional)
        Type: boolean
      
      - `notification_level` (optional)
        Type: integer
      
      - `bookmarked` (optional)
        Type: boolean
      
      - `liked` (optional)
        Type: boolean
      
      - `views` (optional)
        Type: integer
      
      - `like_count` (optional)
        Type: integer
      
      - `has_summary` (optional)
        Type: boolean
      
      - `last_poster_username` (optional)
        Type: string
      
      - `category_id` (optional)
        Type: integer
      
      - `op_like_count` (optional)
        Type: integer
      
      - `pinned_globally` (optional)
        Type: boolean
      
      - `featured_link` (optional)
        Type: string; nullable
      
      - `posters` (optional)
        Type: Array<object>
        
        Items:
          Type: object
          
          - `extras` (optional)
            Type: string; nullable
          
          - `description` (optional)
            Type: string
          
          - `user_id` (optional)
            Type: integer
          
          - `primary_group_id` (optional)
            Type: integer; nullable

## Examples

### cURL

```bash
curl -X GET 'https://discourse.example.com/top.json' \
  -H 'Api-Key: string' \
  -H 'Api-Username: string'
```

### JavaScript

```javascript
const response = await fetch('https://discourse.example.com/top.json', {
  method: 'GET',
  headers: {
    'Api-Key': 'string',
    'Api-Username': 'string',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://discourse.example.com/top.json',
    headers={
        'Api-Key': 'string',
        'Api-Username': 'string',
    },
)
print(response.text)
```
