Skip to content

Repository files navigation

ScrapeBadger

ScrapeBadger C++ SDK

version CI license

Official C++ SDK for ScrapeBadger — one API key for 30+ scraping APIs: Twitter/X, Reddit, Facebook, Instagram, TikTok, YouTube, Amazon, eBay, Walmart, Vinted, Google (18 products), Bing, Yahoo, ChatGPT, Perplexity, real estate, and any URL via the general Web Scraping API. Generated from the ScrapeBadger OpenAPI spec — always in sync with the API. ⚠️ This repository is regenerated automatically; don't send PRs here, request changes via the roadmap.

📚 API docs · 🧰 All SDKs · 🔑 Get an API key — 1,000 free credits

🚀 Install

# requires cpprestsdk + CMake
cmake -B build && cmake --build build -j

⚡ Quick start

#include "ApiClient.h"
#include "ApiConfiguration.h"
#include "api/TwitterApi.h"

using namespace scrapebadger::api;

auto config = std::make_shared<ApiConfiguration>();
config->setBaseUrl(U("https://scrapebadger.com"));
config->setApiKey(U("X-API-Key"), U("YOUR_API_KEY"));

auto client = std::make_shared<ApiClient>(config);
TwitterApi twitter(client);
auto user = twitter.twitterGetUserByUsername(U("elonmusk")).get();

Every scraper is available as its own API class (TwitterApi, AmazonApi, GoogleApi, …) with one method per endpoint — the full list is in the reference below.

🛠 Development

sudo apt-get install -y libcpprest-dev libboost-all-dev cmake   # deps (debian)
cmake -B build && cmake --build build -j                        # compile

C++ API client

Unified credit-based scraping API. https://docs.scrapebadger.com

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI spec from a remote server, you can easily generate an API client.

  • API version: 0.1.0

  • Package version: 0.1.0

  • Generator version: 7.10.0

  • Build package: org.openapitools.codegen.languages.CppRestSdkClientCodegen

  • API namespace: org.openapitools.client.api

  • Model namespace: org.openapitools.client.model

Installation

Prerequisites

Install cpprestsdk.

  • Windows: vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows
  • Mac: brew install cpprestsdk
  • Linux: sudo apt-get install libcpprest-dev

Build

cmake -DCPPREST_ROOT=/usr -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib"
make

Build on Windows with Visual Studio (VS2017)

  • Right click on folder containing source code
  • Select 'Open in visual studio'
  • Once visual studio opens, CMake should show up in top menu bar.
  • Select CMake > Build All.

*Note: If the CMake menu item doesn't show up in Visual Studio, CMake for Visual Studio must be installed. In this case, open the 'Visual Studio Installer' application. Select 'modify' Visual Studio 2017. Make sure 'Desktop Development with C++' is installed, and specifically that 'Visual C++ tools for CMake' is selected in the 'Installation Details' section.

Also be sure to review the CMakeLists.txt file. Edits are likely required.*

Author

About

Official C++ SDK for ScrapeBadger - Web scraping APIs for Twitter, Google, Amazon and more (generated from OpenAPI)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages