# List tickers

Every ticker tagged on at least one article.

`GET https://api.marketnewsapi.com/v1/tickers`

Use a returned `symbol` with the `tickers` filter, or subscribe to `ticker:{symbol}` on the WebSocket. A symbol appears once it has been tagged on an article, including the archive. `articles` is the total. `by_type` splits that total into `news`, `press_release`, and `legal`. Optional filters limit the list, and the counts, to tickers that have an article of that category or type.

Requires an API key. See [authentication](/docs/authentication).

## Query parameters

- `category` (string) Only tickers tagged on an article in this category. One of `stocks`.
- `type` (string) Only tickers tagged on an article of this type. One of `news`, `press_release`, `legal`.

## Example request

```curl
curl "https://api.marketnewsapi.com/v1/tickers" \
 -H "Authorization: Bearer $MARKETNEWSAPI_KEY"
```

```python
import json
import os

import requests

resp = requests.get(
 "https://api.marketnewsapi.com/v1/tickers",
 headers={"Authorization": f"Bearer {os.environ['MARKETNEWSAPI_KEY']}"},
 timeout=10,
)
resp.raise_for_status()
print(json.dumps(resp.json(), indent=2))
```

```javascript
const res = await fetch("https://api.marketnewsapi.com/v1/tickers", {
 headers: { Authorization: `Bearer ${process.env.MARKETNEWSAPI_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.marketnewsapi.com/v1/tickers", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("MARKETNEWSAPI_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
 panic(err)
	}
	defer res.Body.Close()

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

```php
<?php
$ch = curl_init('https://api.marketnewsapi.com/v1/tickers');
curl_setopt_array($ch, [
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('MARKETNEWSAPI_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($body);
```

```ruby
require "json"
require "net/http"

uri = URI("https://api.marketnewsapi.com/v1/tickers")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch('MARKETNEWSAPI_KEY')}"

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.pretty_generate(JSON.parse(res.body))
```

```csharp
using System.Net.Http.Headers;

using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
 "Bearer", Environment.GetEnvironmentVariable("MARKETNEWSAPI_KEY"));

var json = await http.GetStringAsync("https://api.marketnewsapi.com/v1/tickers");
Console.WriteLine(json);
```

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
 public static void main(String[] args) throws Exception {
 HttpRequest req = HttpRequest.newBuilder()
 .uri(URI.create("https://api.marketnewsapi.com/v1/tickers"))
 .header("Authorization", "Bearer " + System.getenv("MARKETNEWSAPI_KEY"))
 .build();

 HttpResponse<String> res = HttpClient.newHttpClient()
 .send(req, HttpResponse.BodyHandlers.ofString());
 System.out.println(res.body());
 }
}
```

## Example response

200 OK

```json
{
 "data": [
 {
 "symbol": "AAPL",
 "articles": 640,
 "by_type": {
 "news": 410,
 "press_release": 168,
 "legal": 62
 }
 },
 {
 "symbol": "MSFT",
 "articles": 512,
 "by_type": {
 "news": 301,
 "press_release": 154,
 "legal": 57
 }
 },
 {
 "symbol": "NVDA",
 "articles": 870,
 "by_type": {
 "news": 540,
 "press_release": 220,
 "legal": 110
 }
 }
 ],
 "meta": {
 "count": 3
 }
}
```

## Try it

## Errors

This endpoint returns the standard [error format](/docs/errors). The most common errors are `400 invalid_parameter`, `401 invalid_api_key` and `429 daily_limit_reached` (Free plan).
