```yaml
product: AlterLab
title: "How to Extract Publicly Listed Profile Data | AlterLab | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/how-to/scrape-social-media-profiles
```

Intermediate4 steps

# How to Extract Publicly Listed Profile Data

Professional directories and public-facing profile pages contain publicly listed information — names, job titles, locations, and professional summaries — that businesses use for market research and lead generation.

## Step-by-Step Guide

1

### Target public directory pages only

Focus on publicly accessible directory listings — pages that appear in Google search results and require no login to view. Avoid platforms with explicit scraping restrictions.

2

### Review terms of service

Check the target directory's terms of service before scraping. Some directories explicitly permit non-commercial data collection; others restrict it. Always comply with the platform's stated policies.

3

### Fetch directory listing pages

Send the directory search result pages to AlterLab. Use filters to narrow results by industry, location, or job title.

4

### Extract profile data

Parse name, title, company, and location from each profile card. Avoid extracting personal contact details not intended for public business use.

## Code Example

Python

```
import requests
from bs4 import BeautifulSoup

def extract_profiles(directory_url: str, api_key: str) -> list[dict]:
    response = requests.post(
        "https://alterlab.io/api/v1/scrape",
        headers={"X-API-Key": api_key, "Content-Type": "application/json"},
        json={"url": directory_url, "render_js": "auto"},
    )
    html = response.json().get("html", "")
    soup = BeautifulSoup(html, "html.parser")

    profiles = []
    for card in soup.select(".profile-card"):
        profiles.append({
            "name": card.select_one(".name")?.get_text(strip=True),
            "title": card.select_one(".job-title")?.get_text(strip=True),
            "company": card.select_one(".company")?.get_text(strip=True),
            "location": card.select_one(".location")?.get_text(strip=True),
        })
    return profiles
```

Replace `YOUR_API_KEY` with your key from the . No credit card required.

## Try this yourself with AlterLab

Run this tutorial on live websites with AlterLab's API. New accounts get up to 5,000 free requests — no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

## Frequently Asked Questions

### Which platforms allow scraping public profiles?

This varies by platform and jurisdiction. Always review the specific platform's terms of service and robots.txt before scraping. AlterLab is designed for extracting publicly available data — users are responsible for compliance with applicable terms and laws.

### Responsible Use

AlterLab is designed for extracting publicly available data. Always review the terms of service for any website you access, respect `robots.txt` directives, and ensure your use case complies with applicable laws in your jurisdiction.

### More tutorials

Browse all [how-to guides](https://alterlab.io/how-to) for web scraping — from beginner extractions to advanced multi-page pipelines.

## Your first scrape. Sixty seconds.

Up to 5,000 free requests — about 5,000 Light, 500 Protected or 250 Dynamic requests. No credit card. 
Just a POST request.

terminal

curl -X POST https://api.alterlab.io/v1/scrape \

-H "X-API-Key: YOUR_KEY" \

-H "Content-Type: application/json" \

-d '{"url": "https://example.com", "formats": ["markdown"]}'

[Start building free](https://alterlab.io/signin)

No credit card required · Up to 5,000 free requests (about 5,000 Light, 500 Protected or 250 Dynamic requests) · Balance never expires