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.
📚 API docs · 🧰 All SDKs · 🔑 Get an API key — 1,000 free credits
# requires cpprestsdk + CMake
cmake -B build && cmake --build build -j
#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.
sudo apt-get install -y libcpprest-dev libboost-all-dev cmake # deps (debian)
cmake -B build && cmake --build build -j # compileUnified credit-based scraping API. https://docs.scrapebadger.com
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
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
cmake -DCPPREST_ROOT=/usr -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib"
make- 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.*
