Validate the input in the Apify Console first
The fastest way to avoid API debugging is to run the exact JSON input once in the Apify Console. Confirm that the dataset contains the fields you need, then reuse the same input body in your API call.
Start with one channel and two results. Large channel lists make it harder to distinguish an input mistake from a source-specific data issue.
Keep the token outside your code
Store the Apify token in an environment variable or secret manager. Do not place a real token in browser code, a public repository, screenshots, or a client-side application.
The examples below use YOUR_APIFY_TOKEN as a placeholder. Replace it only in your local environment or server-side secret configuration.
Start a run and read the dataset
An asynchronous run is the safer pattern for larger jobs: start the actor, poll the run until it reaches a terminal status, then read the default dataset ID returned by the run object.
For a tiny workflow, Apify also provides synchronous endpoints. Use the API tab on the live listing to confirm the current endpoint and client examples before production use.
Design for partial field availability
YouTube does not expose every metric, About link, or transcript for every video. Your integration should accept null values, inspect transcriptStatus and scrapingStatus, and keep videoUrl or id as the stable record key.
Do not fail an entire batch because one channel has only Shorts or one video has no caption track. Handle those states explicitly in downstream code.