This repository contains two starter clients (Node.js and Python) for the live test.
Your task will be to:
- Write a BigQuery query that normalizes
gclidvalues (provided separately in the test statement). - Use the starter code to fetch results from BigQuery.
- Send the results to an API — in this case, we will use https://webhook.site so you can see exactly what your code posts.
node.js/
index.js # Node.js starter code
python/
main.py # Python starter code
README.md # this file
- Access to Google BigQuery with a service account that can run queries.
- A local environment with either:
- Node.js 18+ (for the Node.js version), or
- Python 3.9+ (for the Python version).
You need to set up Google Cloud authentication before running:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"- Go to https://webhook.site.
- Copy your unique URL (it will look like
https://webhook.site/#!/<uuid>). - Replace the placeholder API URL in the code with your webhook URL:
- In Node.js (
query-and-send.js):const url = "https://webhook.site/<your-uuid>";
- In Python (
query_and_send.py):url = "https://webhook.site/<your-uuid>"
- In Node.js (
- Run the script — the payload will be posted to your webhook.
- Check the webhook.site page to see the incoming request body, headers, etc.
Install dependencies:
cd node.js
npm installRun:
node query-and-send.jsInstall dependencies:
cd python
pip install -r requirements.txtContents of requirements.txt:
google-cloud-bigquery
requests
Run:
python query_and_send.py- Replace the placeholder query with your real BigQuery SQL.
- Adapt the payload structure so that it sends:
{ "date": "YYYY-MM-DD", "records": [ { "user_id": "...", "gclid": "...", "click_ts": "ISO-8601", "source": "..." } ] } - Post this JSON to your webhook.site URL.
- Verify in webhook.site that the payload matches expectations.
- The code already has a
sendToApi/send_to_apifunction — just update the URL and payload. - If you cannot connect to BigQuery in your environment, you may simulate query results by hardcoding a small list of rows in the script.
- Be ready to explain your code and your reasoning during the live test.