Data sources
By default, listening collections use Lantfly's own scrapers. Data sources let you add your own official API keys so collections can read more, and more steadily, from the platforms that offer an API. Open Settings → Data sources.
Only the owner and admins of an account manage data sources. Other members see a note to ask an admin.
Providers
| Provider | Platform | What you enter |
|---|---|---|
| YouTube Data API | YouTube | API key from your Google Cloud project |
| Instagram Graph API | Access token and Instagram Business Account ID of your own Business or Creator account (through Facebook Login) | |
| Reddit API | Client ID and Client secret of your own Reddit app (a script or web app from reddit.com/prefs/apps) | |
| Scraping vendor | Several platforms | An API token of a supported third-party scraping vendor, used as a paid fallback |
Add a key
- Click Add data source.
- Pick the Provider, give the key a Name (for example "Marketing key"), and paste the secret fields.
- Click Add.
Secrets are stored encrypted. After saving, only the end of each value is shown, and they are never shown again. To change a secret, edit the key and paste the new value; fields you leave empty keep their value.
Check now tests a key right away and shows its status and, when the provider reports it, its usage and reset time.
Key status
| Status | Meaning |
|---|---|
ok | The key works. |
exhausted | Its quota or credit is used up, until the provider's reset (or a recheck every 10 minutes when the reset is unknown). |
invalid | The provider refused it. It is rechecked every 10 minutes. |
cooldown | Temporary errors; it is retried after a pause that grows up to 6 hours. |
A key that is not ok is skipped and comes back on its own when a check succeeds. The list also shows when each key was
Last used and Last checked, and its last error.
Order and switching
Keys of a provider are tried from top to bottom; change their Order in the list. Under Which key, choose:
| Option | Behavior |
|---|---|
| In order, next one on failure | Always the first working key in the order; the next one only when it fails. The default. |
| Rotate between keys | Each run starts with the next working key, to spread quota across keys. |
| Only the chosen key | One key per provider, never switches. |
Under When every key of a provider is unusable, choose Go on with the free ways (the collection carries on with Lantfly's own scrapers, the default) or Stop and report it (the source ends with a status naming the provider, so you know to add or top up a key).
Prefer the vendor first puts the paid scraping vendor first instead of last. It is faster and steadier when platforms block a lot, but every collection then uses the vendor's credit. A listening project can override this in its own settings, and you can pick a key for a single collection when you collect now.
API
| Request | What it does |
|---|---|
GET /api/v3/data-sources | Keys (masked) with their status, the providers and their fields, and the settings |
POST /api/v3/data-sources | Add a key: provider (youtube_api, instagram_graph, reddit, …), label, secret, optional priority, is_enabled |
PATCH /api/v3/data-sources/:id | Change label, is_enabled, priority or secret fields |
DELETE /api/v3/data-sources/:id | Remove a key |
PATCH /api/v3/data-sources/priorities | { "ids": [...] } in the order to try them |
PUT /api/v3/data-sources/settings | credential_mode (failover, round_robin, pinned), pinned_credentials, on_keys_exhausted (continue, stop), prefer_vendor |
POST /api/v3/data-sources/credentials/:id/check | Test a key now |
curl -s -X POST "https://lantfly.com/api/v3/data-sources" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "youtube_api",
"label": "Marketing key",
"secret": { "api_key": "YOUR_YOUTUBE_API_KEY" }
}'
See Listening for how collections use these keys.