---
sidebar_position: 30
title: Directory
---

This page includes some example jobs for building a data feed. You can view the expected JSON schema at **[/api/tasks](/api/tasks)**.

Live on-chain examples can be found on our **[explorer](https://switchboard.xyz/explorer)**.

import { IoPricetags } from "react-icons/io5";
import { SerumIcon } from "/src/components/icons/SerumIcon";
import { MangoIcon } from "/src/components/icons/MangoIcon";
import { JupiterIcon } from "/src/components/icons/JupiterIcon";
import { OrcaIcon } from "/src/components/icons/OrcaIcon";
import { BiCylinder } from "react-icons/bi";
import { MdOutlineSportsBasketball } from "react-icons/md";
import { SiJpeg } from "react-icons/si";
import { MdOutlineAccessTimeFilled } from "react-icons/md";
import { FcMultipleInputs } from "react-icons/fc";
import { GiPiggyBank } from "react-icons/gi";
import { GiGrainBundle } from "react-icons/gi";

## <IoPricetags className="devicons" />Exchange APIs

Switchboard oracles can fetch the price of assets listed on various exchanges by using a combination of the httpTask, websocketTask, and the jsonParseTask. If the data is on a public API, Switchboard oracles can return it.

<details>
<summary>

### FtxUs

</summary>

```json title="FtxUs_BTC_USD.json"
{
  "name": "FtxUs BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://ftx.us/api/markets/btc/usd"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.result.price"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### FtxCom

</summary>

```json title="FtxCom_BTC_USD.json"
{
  "name": "FtxCom BTC/USD",
  "tasks": [
    {
      "websocketTask": {
        "url": "wss://ftx.com/ws/",
        "subscription": "{\"op\":\"subscribe\",\"channel\":\"ticker\",\"market\":\"BTC/USD\"}",
        "maxDataAgeSeconds": 15,
        "filter": "$[?(@.type == 'update' && @.channel == 'ticker' && @.market == 'BTC/USD')]"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.data.bid"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data.ask"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data.last"
            }
          }
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Coinbase

</summary>

```json title="Coinbase_BTC_USD.json"
{
  "name": "Coinbase BTC/USD",
  "tasks": [
    {
      "websocketTask": {
        "url": "wss://ws-feed.pro.coinbase.com",
        "subscription": "{\"type\":\"subscribe\",\"product_ids\":[\"BTC-USD\"],\"channels\":[\"ticker\",{\"name\":\"ticker\",\"product_ids\":[\"BTC-USD\"]}]}",
        "maxDataAgeSeconds": 15,
        "filter": "$[?(@.type == 'ticker' && @.product_id == 'BTC-USD')]"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.price"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### BinanceUs

</summary>

```json title="BinanceUs_BTC_USD.json"
{
  "name": "BinanceUs BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://www.binance.us/api/v3/ticker/price?symbol=BTCUSD"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.price"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### BinanceCom

</summary>

```json title="BinanceCom_BTC_USD.json"
{
  "name": "BinanceCom BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://www.binance.com/api/v3/ticker/price?symbol=BTCUSDT"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.price"
      }
    },
    {
      "multiplyTask": {
        /* Mainnet USDT/USD Feed */
        "aggregatorPubkey": "5mp8kbkTYwWWCsKSte8rURjTuyinsqBpJ9xAQsewPDD"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Bitfinex

</summary>

```json title="Bitfinex_BTC_USD.json"
{
  "name": "Bitfinex BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://api-pub.bitfinex.com/v2/tickers?symbols=tBTCUSD"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$[0][1]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$[0][3]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$[0][7]"
            }
          }
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Bitstamp

</summary>

```json title="Bitstamp_BTC_USD.json"
{
  "name": "Bitstamp BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://www.bitstamp.net/api/v2/ticker/btcusd"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.ask"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.bid"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.last"
            }
          }
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Kraken

</summary>

```json title="Kraken_BTC_USD.json"
{
  "name": "Kraken BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://api.kraken.com/0/public/Ticker?pair=XXBTZUSD"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.result.XXBTZUSD.a[0]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.result.XXBTZUSD.b[0]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.result.XXBTZUSD.c[0]"
            }
          }
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Okex

</summary>

```json title="Okex_BTC_USD.json"
{
  "name": "Okex BTC/USD",
  "tasks": [
    {
      "websocketTask": {
        "url": "wss://ws.okex.com:8443/ws/v5/public",
        "subscription": "{\"op\":\"subscribe\",\"args\":[{\"channel\":\"tickers\",\"instId\":\"BTC-USDT\"}]}",
        "maxDataAgeSeconds": 15,
        "filter": "$[?(@.event != 'subscribe' && @.arg.channel == 'tickers' && @.arg.instId == 'BTC-USDT' && @.data[0].instType == 'SPOT' && @.data[0].instId == 'BTC-USDT')]"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.data[0].bidPx"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data[0].askPx"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data[0].last"
            }
          }
        ]
      }
    },
    {
      "multiplyTask": {
        /* Mainnet USDT/USD Feed */
        "aggregatorPubkey": "5mp8kbkTYwWWCsKSte8rURjTuyinsqBpJ9xAQsewPDD"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Huobi

</summary>

```json title="Huobi_BTC_USD.json"
{
  "name": "Huobi BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://api.huobi.pro/market/detail/merged?symbol=btcusdt"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.tick.bid[0]"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.tick.ask[0]"
            }
          }
        ]
      }
    },
    {
      "multiplyTask": {
        /* Mainnet USDT/USD Feed */
        "aggregatorPubkey": "5mp8kbkTYwWWCsKSte8rURjTuyinsqBpJ9xAQsewPDD"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Mxc

</summary>

```json title="Mxc_BTC_USD.json"
{
  "name": "Mxc BTC/USD",
  "tasks": [
    {
      "httpTask": {
        "url": "https://www.mxc.com/open/api/v2/market/ticker?symbol=BTC_USDT"
      }
    },
    {
      "medianTask": {
        "tasks": [
          {
            "jsonParseTask": {
              "path": "$.data[0].ask"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data[0].bid"
            }
          },
          {
            "jsonParseTask": {
              "path": "$.data[0].last"
            }
          }
        ]
      }
    },
    {
      "multiplyTask": {
        /* Mainnet USDT/USD Feed */
        "aggregatorPubkey": "5mp8kbkTYwWWCsKSte8rURjTuyinsqBpJ9xAQsewPDD"
      }
    }
  ]
}
```

</details>

## <SerumIcon className="devicons" />Serum

Switchboard can fetch the price of any asset listed on Serum's decentralized exchange. The Serum task will fetch the lowest ask, highest bid, and last fill price and return the median. If no last fill price is found, the Serum task will return the average of the lowest ask and highest bid.

<details>
<summary>

### BTC/USD Pool

</summary>

```json title="Serum_BTC_USD.json"
{
  "name": "Serum BTC/USD",
  "tasks": [
    {
      "serumSwapTask": {
        /* Mainnet Serum BTC/USDC Pool */
        "serumPoolAddress": "A8YFbxQYFVqKZaoYJLLUVcQiWP7G2MeEgW5wsAQgMvFw"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### MNGO/USD Pool

</summary>

```json title="Serum_MNGO_USD.json"
{
  "name": "Serum MNGO/USD",
  "tasks": [
    {
      "serumSwapTask": {
        /* Mainnet Serum MNGO/USDC Pool */
        "serumPoolAddress": "3d4rzwpy9iGdCZvgxcu7B1YocYffVLsQXPXkBZKt2zLc"
      }
    }
  ]
}
```

</details>

## OracleTask

Switchboard can fetch the current price of a Solana oracle protocol

<details>
<summary>

### Switchboard SOL/USDC

</summary>

```json title="Serum_MNGO_USD.json"
{
  "name": "JupiterSwap JSOL to USDC",
  "tasks": [
    {
      "jupiterSwapTask": {
        /* JSOL mint address */
        "inTokenAddress": "7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn",
        /* USDC mint address */
        "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      }
    }
  ]
}
```

</details>

## <JupiterIcon className="devicons" />JupiterSwap

Switchboard can be used to fetch the best swap price using JupiterSwap.

<details>
<summary>

### JSOL to USDC Swap

</summary>

```json title="Jupiter_JSOL_to_USDC.json"
{
  "name": "JupiterSwap JSOL to USDC",
  "tasks": [
    {
      "jupiterSwapTask": {
        /* JSOL mint address */
        "inTokenAddress": "7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn",
        /* USDC mint address */
        "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      }
    }
  ]
}
```

</details>

## OrcaSwap

Switchboard can be used to fetch the best swap price using OrcaSwap.

<details>
<summary>

### GMT to USD Swap

</summary>

```json title="Orca_GMT_USD.json"
{
  "name": "OrcaSwap GMT to USD",
  "tasks": [
    {
      "lpExchangeRateTask": {
        "orcaPoolTokenMintAddress": "CFxQF5kNAtbbDj298Xr47Sf4mkSyuzWpRH97hrdQ6kxi"
      }
    },
    {
      "multiplyTask": {
        "aggregatorPubkey": "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW"
      }
    }
  ]
}
```

</details>

## <MdOutlineAccessTimeFilled className="devicons" />TWAP

Aggregators can be initialized with a history buffer to store a buffer of accepted results. The TWAP task will parse the history buffer, filter the results within the specified period, and return the average.

<details>
<summary>

### BTC/USD 15min TWAP

</summary>

```json title="BTC_USD_15m_TWAP.json"
{
  "name": "BTC/USD 15min TWAP",
  "tasks": [
    {
      "twapTask": {
        /* Mainnet BTC/USD Feed */
        "aggregatorPubkey": "8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee",
        "period": 900
      }
    }
  ]
}
```

</details>

<details>
<summary>

### SOL/USD 30min TWAP

</summary>

```json title="SOL_USD_30m_TWAP.json"
{
  "name": "SOL/USD 30min TWAP",
  "tasks": [
    {
      "twapTask": {
        /* Mainnet SOL/USD Feed */
        "aggregatorPubkey": "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR",
        "period": 1800
      }
    }
  ]
}
```

</details>

## <GiPiggyBank className="devicons" />Lending Rates

Switchboard oracles can resolve the lending and borrow rates for the following Solana lending programs:

- Jet
- Solend
- Mango
- 01
- Apricot
- Larix
- Port
- Tulip

Thanks to JetProtocol for their work building the [defi-yield-ts](https://github.com/jet-lab/defi-yield-ts) library.

A `field` of 1 represents a borrow rate and a `field` of 0 represents a lending rate.

<details>
<summary>

### Solend StSOL Borrow Rate

</summary>

```json title="Solend_StSol_Borrow_Rate.json"
{
  "name": "Solend stSOL Borrow Rate",
  "tasks": [
    {
      "lendingRateTask": {
        "protocol": "solend",
        "assetMint": "7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",
        "field": 1
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Jet BTC Lending Rate

</summary>

```json title="Jet_Btc_Lending_Rate.json"
{
  "name": "JET BTC Lend Rate",
  "tasks": [
    {
      "lendingRateTask": {
        "protocol": "jet",
        "assetMint": "9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E",
        "field": 0
      }
    }
  ]
}
```

</details>

## <MangoIcon className="devicons" />Mango Perps

Switchboard oracles can be used to resolve the price on Mango's perpetual markets. You can find a list of market addresses in their [mango-client-v3](https://github.com/blockworks-foundation/mango-client-v3/blob/main/src/ids.json) repo.

<details>
<summary>

### Mango BTC Perps

</summary>

```json title="Mango_Perps_Btc.json"
{
  "tasks": [
    {
      "mangoPerpMarketTask": {
        "perpMarketAddress": "DtEcjPLyD4YtTBB4q8xwFZ9q49W89xZCZtJyrGebi5t8"
      }
    }
  ]
}
```

</details>

## <FcMultipleInputs className="devicons" />LP Token Prices

Switchboard oracles can fetch the price of LP tokens from Mercurial, Saber, Orca, and Raydium. If the `useFairPrice` flag is provided with a list of mainnet aggregators, the oracles will return the fair LP token price. See our [blog post](https://switchboardxyz.medium.com/fair-lp-token-oracles-94a457c50239) for more details on how this value is calculated.

<details>
<summary>

### Mercurial USDC/USDT/wUST

</summary>

```json title="Mercurial_USDC_USDT_wUST.json"
{
  "name": "LP Mercurial USDC/USDT/wUST",
  "tasks": [
    {
      "lpTokenPriceTask": {
        /* Mainnet Mercurial 3Pool wUST Pool Address */
        "mercurialPoolAddress": "USD6kaowtDjwRkN5gAjw1PDMQvc9xRp8xW9GK8Z5HBA"
      }
    }
  ]
}
```

You have the option of using the fair LP token price by providing the `useFairPrice` flag and providing a list of aggregators to use for the pool member prices.

```json title="FairPrice_Mercurial_USDC_USDT_wUST.json"
{
  "name": "Fair Price LP Mercurial USDC/USDT/wUST",
  "tasks": [
    {
      "lpTokenPriceTask": {
        "useFairPrice": true,
        /* Mainnet Mercurial 3Pool wUST Pool Address */
        "mercurialPoolAddress": "USD6kaowtDjwRkN5gAjw1PDMQvc9xRp8xW9GK8Z5HBA",
        "priceFeedAddresses": [
          /* Mainnet USDC/USD Feed */
          "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW",
          /* Mainnet USDT/USD Feed */
          "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9",
          /* Mainnet wUST/USD Feed */
          "3RfJxApwV2tYB5mArdD7aRbBk7P6BQCSSFQzR2GXUzA2"
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Saber USDT/USDC

</summary>

```json title="Saber_LP_Token_USDT_USDC.json"
{
  "name": "Saber USDT/USDC",
  "tasks": [
    {
      "lpTokenPriceTask": {
        /* Mainnet Saber USDT/USDC Pool Address */
        "saberPoolAddress": "YAkoNb6HKmSxQN9L8hiBE5tPJRsniSSMzND1boHmZxe",
        "priceFeedAddresses": [
          /* Mainnet USDT/USD Feed */
          "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9",
          /* Mainnet USDC/USD Feed */
          "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW"
        ]
      }
    }
  ]
}
```

You have the option of using the fair LP token price by providing the `useFairPrice` flag and providing a list of aggregators to use for the pool member prices.

```json title="FairPrice_Saber_LP_Token_USDT_USDC.json"
{
  "name": "Fair Price Saber USDT/USDC",
  "tasks": [
    {
      "lpTokenPriceTask": {
        "useFairPrice": true,
        /* Mainnet Saber USDT/USDC Pool Address */
        "saberPoolAddress": "YAkoNb6HKmSxQN9L8hiBE5tPJRsniSSMzND1boHmZxe",
        "priceFeedAddresses": [
          /* Mainnet USDT/USD Feed */
          "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9",
          /* Mainnet USDC/USD Feed */
          "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW"
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Orca USDT/USDC

</summary>

```json title="Orca_USDT_USDC_LP.json"
{
  "name": "Orca LP USDT/USDC",
  "tasks": [
    {
      "lpTokenPriceTask": {
        /* Mainnet Orca USDT/USDC Pool Address */
        "orcaPoolAddress": "H2uzgruPvonVpCRhwwdukcpXK8TG17swFNzYFr2rtPxy",
        "priceFeedAddresses": [
          /* Mainnet USDC/USD Feed */
          "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW",
          /* Mainnet USDT/USD Feed */
          "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9"
        ]
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Raydium SOL/USDC

</summary>

```json title="Raydium_SOL_USDC_LP.json"
{
  "name": "Raydium SOL/USDC",
  "tasks": [
    {
      "lpTokenPriceTask": {
        /* Mainnet Raydium SOL/USDC Pool Address */
        "raydiumPoolAddress": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
        "priceFeedAddresses": [
          /* Mainnet SOL/USD Feed */
          "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR",
          /* Mainnet USDC/USD Feed */
          "BjUgj6YCnFBZ49wF54ddBVA9qu8TeqkFtkbqmZcee8uW"
        ]
      }
    }
  ]
}
```

</details>

## <GiGrainBundle className="devicons" />Commodities

<details>
<summary>

### Unleaded Fuel

</summary>

```json title="Average_Price_Unleaded_Fuel.json"
{
  "tasks": [
    {
      "httpTask": {
        "url": "https://gasprices.aaa.com/wp-admin/admin-ajax.php",
        "method": 2,
        "headers": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": "action=states_cost_data&data%5BlocL%5D=US&data%5BlocR%5D=US"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.data.unleaded.[0]"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### Gold

</summary>

```json title="Metals_live_Gold.json"
{
  "tasks": [
    { "httpTask": { "url": "https://api.metals.live/v1/spot/gold" } },
    { "jsonParseTask": { "path": "$[(@.length-1)].price" } }
  ]
}
```

```json title="Asg_Gold.json"
{
  "tasks": [
    { "httpTask": { "url": "https://data-asg.goldprice.org/dbXRates/USD" } },
    { "jsonParseTask": { "path": "$.items[?(@.curr == \"USD\")].xauPrice" } }
  ]
}
```

</details>

<details>
<summary>

### Silver

</summary>

```json title="Metals_live_Silver.json"
{
  "tasks": [
    { "httpTask": { "url": "https://api.metals.live/v1/spot/silver" } },
    { "jsonParseTask": { "path": "$[(@.length-1)].price" } }
  ]
}
```

```json title="Asg_Silver.json"
{
  "tasks": [
    { "httpTask": { "url": "https://data-asg.goldprice.org/dbXRates/USD" } },
    { "jsonParseTask": { "path": "$.items[?(@.curr == \"USD\")].xagPrice" } }
  ]
}
```

</details>

## <SiJpeg className="devicons" />NFTs

Switchboard oracles can be used to fetch the floor price of various NFTs.

<details>
<summary>

### Solana Monkey Business

</summary>

```json title="NFT_Solana_Monkey_Business.json"
{
  "name": "SMB Floor Price",
  "tasks": [
    {
      "httpTask": {
        "url": "https://market.solanamonkey.business/api/fetchOffers?full=true"
      }
    },
    {
      "jsonParseTask": {
        "path": "$.offers[?(@.price)].price",
        "aggregationMethod": "MIN"
      }
    }
  ]
}
```

```json title="NFT_Solana_Monkey_Business.json"
{
  "name": "SMB Floor Price",
  "tasks": [
    {
      "httpTask": {
        "url": "https://api.solanafloor.com/collections",
        "method": "METHOD_POST"
      }
    },
    {
      "jsonParseTask": {
        "path": "$[?(@.code == 'SMB')].tokenFloor"
      }
    }
  ]
}
```

</details>

<details>
<summary>

### DegenApe

</summary>

```json title="NFT_DegenApe_Floor_Price.json"
{
  "name": "DegenApe Floor Price",
  "tasks": [
    {
      "httpTask": {
        "url": "https://qzlsklfacc.medianetwork.cloud/nft_for_sale?collection=degenape"
      }
    },
    {
      "jsonParseTask": {
        "path": "$[?(@.price)].price",
        "aggregationMethod": "MIN"
      }
    }
  ]
}
```

</details>

## <MdOutlineSportsBasketball className="devicons" />Sports

Switchboard oracles can be used to resolve the outcome of events. The following examples will resolve to the following values:

- **0** - No Result
- **1** - Home Team Win
- **2** - Away Team Win

<details>
<summary>

### European Premier League

</summary>

**ESPN**

```json title="EPL_Man_United_v_Leicester_City_10_16_21.json"
{
  "name": "EPL MAN v LEI 10/16/2021",
  "tasks": [
    {
      "httpTask": {
        "url": "https://site.api.espn.com/apis/site/v2/sports/soccer/eng.1/scoreboard/605965"
      }
    },
    {
      "conditionalTask": {
        "attempt": [
          {
            "conditionalTask": {
              "attempt": [
                {
                  "jsonParseTask": {
                    "path": "$.competitions[?(@.status.type.completed && @.id == '605965')].competitors[?(@.winner && @.homeAway == 'home')].id"
                  }
                },
                {
                  "valueTask": {
                    "value": 1
                  }
                }
              ],
              "onFailure": [
                {
                  "jsonParseTask": {
                    "path": "$.competitions[?(@.status.type.completed && @.id == '605965')].competitors[?(@.winner && @.homeAway == 'away')].id"
                  }
                },
                {
                  "valueTask": {
                    "value": 2
                  }
                }
              ]
            }
          }
        ],
        "onFailure": [
          {
            "conditionalTask": {
              "attempt": [
                {
                  "jsonParseTask": {
                    "path": "$.competitions[?(@.status.type.completed && @.id == '605965')].id"
                  }
                },
                {
                  "valueTask": {
                    "value": 0
                  }
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

**Yahoo**

```json title="EPL_Man_United_v_Leicester_City_10_16_21.json"
{
  "name": "EPL MAN v LEI 10/16/2021",
  "tasks": [
    {
      "httpTask": {
        "url": "https://sports.yahoo.com/soccer/premier-league/leicester-city-manchester-united-2247085"
      }
    },
    {
      "regexExtractTask": {
        "pattern": "root.App.main\\s+=\\s+(\\{.*\\})",
        "groupNumber": 1
      }
    },
    {
      "conditionalTask": {
        "attempt": [
          {
            "conditionalTask": {
              "attempt": [
                {
                  "jsonParseTask": {
                    "path": "$.context.dispatcher.stores.GamesStore.games[?(@.gameid == 'soccer.g.2247085' && @.status_type == 'final' && @.winning_team_id == @.home_team_id)].attendance"
                  }
                },
                {
                  "valueTask": {
                    "value": 1
                  }
                }
              ],
              "onFailure": [
                {
                  "jsonParseTask": {
                    "path": "$.context.dispatcher.stores.GamesStore.games[?(@.gameid == 'soccer.g.2247085' && @.status_type == 'final' && @.winning_team_id == @.away_team_id)].attendance"
                  }
                },
                {
                  "valueTask": {
                    "value": 2
                  }
                }
              ]
            }
          }
        ],
        "onFailure": [
          {
            "conditionalTask": {
              "attempt": [
                {
                  "jsonParseTask": {
                    "path": "$.context.dispatcher.stores.GamesStore.games[?(@.gameid == 'soccer.g.2247085' && @.status_type == 'final')].attendance"
                  }
                },
                {
                  "valueTask": {
                    "value": 0
                  }
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

</details>
