Back to use cases

    Use case / SOCIAL DATA / Python 3 / Published

    Find YouTubers for outreach with Python

    Use Python to find YouTubers by niche and subscriber count. Export a creator shortlist with matching videos, fit reasons and public contact details when listed.

    A niche description flowing through search and task polling to a creator CSV

    Find YouTubers for outreach with a niche description and a Python CLI. This page shows a stored sample with fictional example data. There is no hosted demo.

    The problem

    Finding creators for a campaign means checking topic fit, audience size and relevant videos. Copying channel details into a sheet makes that review repetitive. Marketers need the same fields for each candidate.

    What the app does

    • Searches for creators using a description and subscriber filters.
    • Supports country, keyword and contact requirements.
    • Writes channel links, subscriber counts, fit scores, reasons and matching videos to CSV.
    • Includes public contact details when listed. Email addresses are not verified.
    • Adds local review flags for missing metrics, missing contacts and possible brand channels.
    • Saves a summary and the API's CSV export.

    The output is a shortlist, not a complete list of every creator in a niche.

    How it works

    1. Describe the niche. Build a query with a count and optional filters. The CLI reads its key from --key-file, defaulting to ~/.desearch_api_key. DESEARCH_KEY_FILE can set another path.
    2. Create a task. POST /desearch/people/search/youtube starts the search. The CLI supports an idempotency key and checks its cost estimate before creation.
    3. Check progress. GET /desearch/people/tasks/{task_id} reads status. GET /desearch/people/tasks/{task_id}/results supplies results with cursor pagination and local deduplication.
    4. Review evidence. Rows include matching videos and quality flags. The newest matching video date is not the channel's latest upload. Missing dates remain unknown. The recency flag does not remove creators.
    5. Save files. The CLI writes its CSV and summary, then downloads GET /desearch/people/tasks/{task_id}/export?format=csv. Optional cancellation on timeout uses POST /desearch/people/tasks/{task_id}/cancel.

    The code

    This is the verbatim HTTPClient.results method from youtube_creator_finder.py. The full client supplies authentication from the key file.

    PYTHON
        def results(self, task_id):
            cursor = None
            seen = set()
            while True:
                params = {'limit': 100}
                if cursor is not None:
                    params['cursor'] = cursor
                _, page = self.call('GET', TASKS + task_id + '/results', params=params)
                yield from page.get('results', [])
                following = page.get('next_cursor')
                if page.get('has_more') is False or not following:
                    break
                if following in seen:
                    raise APIError('API returned a repeated results cursor')
                seen.add(following)
                cursor = following
    

    Endpoints

    • POST /desearch/people/search/youtube
    • GET /desearch/people/tasks/{task_id}
    • GET /desearch/people/tasks/{task_id}/results
    • GET /desearch/people/tasks/{task_id}/export?format=csv
    • POST /desearch/people/tasks/{task_id}/cancel

    Example output

    This verbatim field subset comes from samples/sample-summary.md. It accompanies fictional creator rows and example URLs. It is stored sample data, not a new search result.

    task_status: "completed"
    
    completion_reason: "count_reached"
    
    stop_reason: "count_reached"
    
    coverage_limited: false
    
    warnings: []
    
    errors: []

    Run it yourself

    Open the source folder. Create a Python virtual environment and install requirements.txt. Save your key from the console in a file only you can read. Set its path with --key-file or DESEARCH_KEY_FILE.

    Run python youtube_creator_finder.py with --query describing your niche. Add --count, --min-subscribers and repeated --exclude-keyword options as needed. Follow the README's example command. Use --dry-run to inspect the request without an API call. Review the estimate and confirm before starting.

    Use --task-id to fetch an existing task. Files go to output/ by default. Review matching videos, reasons and flags before outreach.

    What it costs

    The recorded five-creator search cost $0.25 on 2026-10-23. Its task summary records final_cost_usd: 0.25 and duration_seconds: 144.45847, measured from task creation to completion. This is one measured run, not a timing guarantee. See pricing before running a search.

    Ideas to extend it

    • Compare shortlists from related niche descriptions.
    • Use --exclude-file with a previous CSV to avoid repeat candidates.
    • Add a review column for campaign fit.
    • Compare matching video dates across saved runs without treating them as channel upload dates.

    Use with AI agents

    Point an MCP client at the hosted Desearch server. Replace the placeholder with a key from the console. Do not commit the key.

    JSON
    {
      "mcpServers": {
        "desearch": {
          "url": "https://mcp.desearch.ai/mcp",
          "headers": {
            "Authorization": "Bearer <key>"
          }
        }
      }
    }

    Prompt you can paste for this example:

    Use Desearch People Search to find YouTube creators for my niche. Read the key from a local key file. Create a task with POST /desearch/people/search/youtube, poll GET /desearch/people/tasks/{task_id}, paginate results and download the CSV export. Apply my subscriber and keyword filters. Keep fit reasons, matching video links and quality flags. The newest matching video date is not the channel's latest upload. Include public contacts only when returned. Do not invent creators or claim complete coverage.

    Build your own example.

    Give your agents access to web and social search. Get an API key to start building, or talk to us about your integration.

    Read docs