# Example queries

30+ questions about the market, each answered by one query across two or three kinds of data.

## 30+ queries

Each is one `POST /v2/scan`. The grammar: https://tickerbot.io/docs/sql.md

### Which stocks beat earnings, are above their 200-day, and just had a price target raised?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "last_earnings_surprise_pct > 0 AND above_sma_200 AND recent_target_raise" }'
```

### Which large caps are 20% off their high but still growing revenue over 10%?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "market_cap > 1e10 AND from_52w_high_pct < -20 AND revenue_growth_yoy_pct > 10" }'
```

### Which stocks are at a 52-week high with news behind it?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "at_52w_high AND recent_news_count > 0" }'
```

### Which heavily shorted stocks report earnings this week?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "short_float_pct > 20 AND earnings_this_week" }'
```

### Which large caps yield over 4% and still grew earnings last year?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "dividend_yield > 0.04 AND earnings_growth_yoy_pct > 0 AND market_cap > 1e10" }'
```

### Which stocks had a golden cross after beating earnings twice in a row?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "golden_cross AND earnings_beat_streak >= 2" }'
```

### Which tech stocks trade under 15 times earnings with positive news sentiment?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "sector = '\''Technology'\'' AND pe_ratio < 15 AND news_volume_weighted_sentiment > 0" }'
```

### Which stocks were upgraded this week and still sit 10% under their target?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "recent_upgrade AND analyst_target_upside_pct > 10" }'
```

### Which ETFs charge under 0.1% and hold over $10B?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "etf_expense_ratio < 0.1 AND etf_net_assets > 1e10" }'
```

### Which large caps were below their 200-day at the October 2023 low, on Oct 27, 2023?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "NOT above_sma_200 AND market_cap > 1e10", "asof": "2023-10-27" }'
```

### Which stocks gapped up more than 5% this morning on news?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "gap_pct > 5 AND recent_news_count > 0" }'
```

### Which stocks under $10 trade more than $50M a day?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "price < 10 AND day_dollar_volume > 5e7" }'
```

### Which large caps hold more cash than debt and bought back stock this month?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "cash_on_hand > total_debt AND buyback_30d AND market_cap > 1e10" }'
```

### Which stocks are oversold on RSI but still above their 200-day?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "rsi_14 < 30 AND above_sma_200" }'
```

### Which stocks reporting this week have beaten four quarters running?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "earnings_this_week AND earnings_beat_streak >= 4" }'
```

### Which stocks with more than ten analysts covering them have a bullish consensus?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "analyst_count_total > 10 AND bullish_consensus" }'
```

### Which recent IPOs are up over the last month?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "recently_ipoed AND change_1m_pct > 0" }'
```

### Which low-float stocks are up more than 10% today?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "low_float AND change_1d_pct > 10" }'
```

### Which heavily shorted stocks with over five days to cover are up more than 3% today?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "short_float_pct > 15 AND days_to_cover > 5 AND change_1d_pct > 3" }'
```

### Which ETFs yield over 3%, charge under 0.2%, and hold over $1B?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "etf_dividend_yield > 0.03 AND etf_expense_ratio < 0.2 AND etf_net_assets > 1e9" }'
```

### Which stocks are in a Bollinger squeeze on thin volume?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "bollinger_squeeze AND relative_volume < 0.7" }'
```

### Which mega caps fell more than 3% this week?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "mega_cap AND change_1w_pct < -3" }'
```

### Which companies grew revenue over 20% and trade under 5 times sales?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "revenue_growth_yoy_pct > 20 AND price_to_sales < 5 AND market_cap > 1e9" }'
```

### Which stocks had an estimate raised this month and sit within 10% of their high?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "eps_estimate_revision_up_30d > 0 AND from_52w_high_pct > -10" }'
```

### Which stocks with a dividend coming up are above their 50-day?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "dividend_approaching AND above_sma_50" }'
```

### Which stocks have their 50-day below their 200-day and just got downgraded?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "death_regime AND recent_downgrade" }'
```

### Which profitable large-cap healthcare stocks are 20% off their high?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "sector = '\''Healthcare'\'' AND from_52w_high_pct < -20 AND profitable AND market_cap > 1e10" }'
```

### Which stocks split recently and are up since?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "split_recent AND change_1m_pct > 0" }'
```

### Which profitable small caps trade under book value?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "small_cap AND profitable AND price_to_book < 1" }'
```

### Which stocks that institutions own more than half of were just upgraded?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "institutions_pct > 50 AND recent_upgrade" }'
```

### Which large caps were 30% off their high at the March 2020 low, on Mar 20, 2020?

```shell
curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "from_52w_high_pct < -30 AND market_cap > 1e10", "asof": "2020-03-20" }'
```
