Skip to content

Instantly share code, notes, and snippets.

View jeanmidevacc's full-sized avatar

Jean-Michel Daignan jeanmidevacc

View GitHub Profile
@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-searchapi_endpoints.md
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io endpoints reference notes - Quebec 2026 election project

SearchApi engines used by the election collector

All calls go through one REST endpoint, https://www.searchapi.io/api/v1/search, differentiated by the engine query param. Each block below is a copy-pasteable snippet (requests) showing how that engine is called and what realistic parameters look like. Queries are mixed across parties/issues/languages so no single one is singled out.

Requires SEARCHAPI_API_KEY set in the environment before running any of them:

@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-google_trends_trending_now.py
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io google_trends_trending_now engine example - currently-trending topics for a geo via the API
@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-google_trends.py
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io google_trends engine example - TIMESERIES/RELATED_QUERIES/RELATED_TOPICS/GEO_MAP via the API
@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-google_rank_tracking.py
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io google_rank_tracking engine example - top-100 organic SERP results via the API
# google_rank_tracking engine — https://www.searchapi.io/docs/google-rank-tracking
# Top-100 organic SERP results for a query.
# Requires SEARCHAPI_API_KEY set in the environment:
# export SEARCHAPI_API_KEY=xxxxxxxxxxxxxxxx
import os
import requests
URL = "https://www.searchapi.io/api/v1/search"
@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-google_news.py
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io google_news engine example - Google News results via the API
# google_news engine — https://www.searchapi.io/docs/google-news
# Requires SEARCHAPI_API_KEY set in the environment:
# export SEARCHAPI_API_KEY=xxxxxxxxxxxxxxxx
import os
import requests
URL = "https://www.searchapi.io/api/v1/search"
API_KEY = os.environ["SEARCHAPI_API_KEY"]
@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-gemini.py
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io gemini engine example - ask Gemini via the API
# gemini engine — https://www.searchapi.io/docs/gemini
# Sends a prompt to Gemini and returns its answer.
# Requires SEARCHAPI_API_KEY set in the environment:
# export SEARCHAPI_API_KEY=xxxxxxxxxxxxxxxx
import os
import requests
URL = "https://www.searchapi.io/api/v1/search"
@jeanmidevacc
jeanmidevacc / searchapi-provincial-election-qc-2026-chatgpt.py
Last active September 20, 2026 21:41
github.com/jeanmidevacc/searchapi-provincial-election-qc-2026 - SearchApi.io chatgpt engine example - ask ChatGPT (with live web search) via the API
# chatgpt engine — https://www.searchapi.io/docs/chatgpt
# Sends a prompt to ChatGPT (with live web search) and returns its answer.
# Requires SEARCHAPI_API_KEY set in the environment:
# export SEARCHAPI_API_KEY=xxxxxxxxxxxxxxxx
import os
import requests
URL = "https://www.searchapi.io/api/v1/search"
name: CI
on:
push:
branches: [main]
tags: ["v*.*.*"]
pull_request:
branches: [main]
jobs:
# formatting check
ruff format --check .
# linter check
ruff check .
# to run all the tests in the test folder
pytest
> tests/integration/test_agent_play.py ........ [ 3%]
tests/integration/test_game_flow.py ...................... [ 12%]
tests/integration/test_logging.py ....... [ 15%]
tests/unit/agents/test_base.py ....... [ 18%]
tests/unit/dungeon/test_card_pool.py ......................... [ 28