Aller au contenu
GET /v1/search

Search current + historical legislators

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/congress-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/congress-api/v1/search" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/congress-api/v1/search", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/congress-api/v1/search");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/congress-api/v1/search",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "data": {
        "count": 20,
        "limit": 20,
        "total": 144,
        "offset": 0,
        "filters": {
            "name": "smith",
            "party": null,
            "state": null,
            "chamber": null,
            "current": null
        },
        "results": [
            {
                "name": "Adam Smith",
                "party": "Democrat",
                "state": "WA",
                "chamber": "house",
                "current": true,
                "bioguide": "S000510",
                "district": 9,
                "govtrack": 400379,
                "served_to": "2027-01-03",
                "term_count": 15,
                "served_from": "1997-01-07"
            },
            {
                "name": "Adrian Smith",
                "party": "Republican",
                "state": "NE",
                "chamber": "house",
                "current": true,
                "bioguide": "S001172",
                "district": 3,
                "govtrack": 412217,
                "served_to": "2027-01-03",
                "term_count": 10,
                "served_from": "2007-01-04"
            },
            {
                "name": "Christopher H. Smith",
                "party": "Republican",
                "state": "NJ",
                "chamber": "house",
                "current": true,
                "bioguide": "S000522",
                "district": 4,
                "govtrack": 400380,
                "served_to": "2027-01-03",
                "term_count": 23,
                "served_from": "1981-01-05"
            },
            {
                "name": "Jason Smith",
                "party": "Republican",
                "state": "MO",
                "chamber": "house",
                "current": true,
                "bioguide": "S001195",
                "district": 8,
                "govtrack": 412596,
                "served_to": "2027-01-03",
                "term_count": 7,
                "served_from": "2013-06-04"
            },
            {
                "name": "Tina Smith",
                "party": "Democrat",
                "state": "MN",
                "chamber": "senate",
                "current": true,
                "bioguide": "S001203",
                "district": null,
                "govtrack": 412742,
                "served_to": "2027-01-03",
                "term_count": 3,
                "served_from": "2018-01-03"
            },
            {
                "name": "William Smith",
                "party": null,
                "state": "MD",
                "chamber": "house",
                "current": false,
                "bioguide": "S000624",
                "district": 4,
                "govtrack": 410099,
                "served_to": "1791-03-03",
                "term_count": 1,
                "served_from": "1789-03-04"
            },
            {
                "name": "Isaac Smith",
                "party": "Federalist",
          
…