## Polymarket Subgraph on Graph Explorer

You can see an interactive query playground on the [Polymarket Subgraph’s page on The Graph Explorer](/content/explorer/subgraphs/Bx1W4S7kDVxs9gC3s2G6DS8kdNBJNVhMviCtin2DiBp?view=Query&chain=arbitrum-one/index.html), where you can test any query.

Polymarket Playground

## How to use the Visual Query Editor

The visual query editor helps you test sample queries from your Subgraph.

You can use the GraphiQL Explorer to compose your GraphQL queries by clicking on the fields you want.

### Example Query: Get the top 5 highest payouts from Polymarket

```

```

### Example output

```

```

## Polymarket’s GraphQL Schema

The schema for this Subgraph is defined [here in Polymarket’s GitHub⁠](https://github.com/Polymarket/polymarket-subgraph/blob/main/polymarket-subgraph/schema.graphql).

### Polymarket Subgraph Endpoint

[https://gateway.thegraph.com/api/{api-key}/subgraphs/id/Bx1W4S7kDVxs9gC3s2G6DS8kdNBJNVhMviCtin2DiBp⁠](https://gateway.thegraph.com/api/%7Bapi-key%7D/subgraphs/id/Bx1W4S7kDVxs9gC3s2G6DS8kdNBJNVhMviCtin2DiBp)

The Polymarket Subgraph endpoint is available on [Graph Explorer](/content/explorer/index.html).

Polymarket Endpoint

## How to Get your own API Key

1. Go to [https://thegraph.com/studio](/content/studio/index.html) and connect your wallet
2. Go to [https://thegraph.com/studio/apikeys/](/content/studio/apikeys/index.html) to create an API key

You can use this API key on any Subgraph in [Graph Explorer](/content/explorer/index.html), and it’s not limited to just Polymarket.

100k queries per month are free which is perfect for your side project!

## Additional Polymarket Subgraphs

- [Polymarket](/content/explorer/subgraphs/81Dm16JjuFSrqz813HysXoUPvzTwE7fsfPk2RTf66nyC?view=Query&chain=arbitrum-one/index.html)
- [Polymarket Activity Polygon](/content/explorer/subgraphs/Bx1W4S7kDVxs9gC3s2G6DS8kdNBJNVhMviCtin2DiBp?view=Query&chain=arbitrum-one/index.html)
- [Polymarket Profit & Loss](/content/explorer/subgraphs/6c58N5U4MtQE2Y8njfVrrAfRykzfqajMGeTMEvMmskVz?view=Query&chain=arbitrum-one/index.html)
- [Polymarket Open Interest](/content/explorer/subgraphs/ELaW6RtkbmYNmMMU6hEPsghG9Ko3EXSmiRkH855M4qfF?view=Query&chain=arbitrum-one/index.html)

## How to Query with the API

You can pass any GraphQL query to the Polymarket endpoint and receive data in json format.

This following code example will return the exact same output as above.

### Sample Code from node.js

```

```

### Additional resources

For more information about querying data from your Subgraph, read more [here](/content/docs/en/subgraphs/querying/introduction/index.html).

To explore all the ways you can optimize & customize your Subgraph for a better performance, read more about [creating a Subgraph here](/content/docs/en/developing/creating-a-subgraph/index.html).
