Poll REST API
Use Poll data and actions in your application through a secure HTTPS API.
Base URL
Send production requests to the following base URL. The API uses JSON for request and response bodies.
https://api.poll.funPublic feed and bet endpoints do not need a token. Account data and all write actions need an access token with the correct scope.
Authentication
Create a Personal Access Token in Poll settings. Send the token as a Bearer token.
curl https://api.poll.fun/api/user \
-H "Authorization: Bearer polld_xxxxx"Give each token only the scopes that the integration needs. See the authentication guide for scope and security details.
Choose an integration
Errors
Check the HTTP status before you use a response. API errors include a short error message. The TypeScript client converts failed responses into PollApiError values with a status code and the original response.
typescript
import { PollApiError } from "@solworks/poll-api-client";
try {
await client.getAccount();
} catch (error) {
if (error instanceof PollApiError) {
console.error(error.statusCode, error.errorMessage);
}
}