
Sympla-Brazil-Events
Pricing
$100.00 / 1,000 events

Sympla-Brazil-Events
Your gateway to discovering events on Sympla Brazil. Search by city and date to find local concerts, workshops, festivals, talks, and more. Access event details, locations, and ticket information effortlessly
0.0 (0)
Pricing
$100.00 / 1,000 events
2
22
7
Last modified
7 months ago
Sympla Event Scraper
Overview
This code is a web scraper designed to extract event data from the Sympla event platform (https://www.sympla.com.br). It's built to be used within the Apify platform, which allows for scheduled or on-demand execution of web scraping tasks. The scraper gathers event information, including details like event name, date, location, organizer, and ticket information, for a specified city.
Features
- Event Listing: Fetches lists of events for a given city, with optional filtering by state and date range.
- Date Range Filtering: Supports filtering events by a start and end date.
- Event Details: Optionally fetches detailed information for each event, including descriptions, venue details, and category.
- Ticket Information: Retrieves ticket details for events, such as prices, availability, and sale dates.
- Pagination: Handles pagination of event listings to retrieve events from multiple pages.
- Error Handling: Includes error handling for API requests and data processing.
- Axios for HTTP Requests: Uses Axios for making HTTP requests.
- Apify Integration: Designed to run on the Apify platform.
- Session Management: (Partial) Attempts to use an Axios session to handle cookie-based access to event details and ticket information.
- Input Schema: Defines the expected input parameters for the scraper.
How it Works
The scraper operates in the following general steps:
- Initialization: The script initializes the Apify actor and retrieves input parameters, including the target city, state, date range, and other options.
- Event List Fetching:
- The fetchEventsByCityfunction is used to retrieve a list of events from Sympla's API. This function constructs a URL with the necessary parameters, including the city, state, and date. It handles pagination to get all events.
- The  dparameter is always included in the request. If a date range is provided,dincludes the start and end dates (YYYY-MM-DD,YYYY-MM-DD). If no date range is provided,ddefaults to today's date (YYYY-MM-DD).
 
- The 
- Event Details and Ticket Fetching (Optional):
- If the fetch_detailsinput parameter is set totrue, the scraper fetches detailed information for each event.
- It uses fetchEventPageDetailsto get event descriptions, venue information, etc.
- It uses fetchEventTicketsto get ticket information.
- A session using Axios is initialized to try to handle cookie requirements for fetching details. If session initialization fails, it falls back to non-session requests.
 
- If the 
- Data Formatting:
- The formatEventDatafunction is used to structure the event data into a consistent format.
- The enhanceEventWithPageDetailsandenhanceEventWithTicketsOnlyfunctions add the detailed information and ticket data to the formatted event objects.
 
- The 
- Data Output:
- The scraper pushes the formatted event data to the Apify dataset, making it available for download or further processing.
 
Input Parameters
The scraper accepts the following input parameters:



















