JSON Payload for POST Request

Starting with JSON body because this is the way that most API documentation will give you the payload examples.

body = '{
    "filters": {
        "keywords": ["money","government"],
        "award_type_codes": [
    "fields": [
        "Award ID",
        "Recipient Name",
        "Action Date",
        "Transaction Amount",
        "Awarding Agency",
        "Awarding Sub Agency",
        "Award Type"
    "page": 1,
    "limit": 35,
    "sort": "Transaction Amount",
    "order": "desc"

Send the body as a JSON string.

POST("https://api.usaspending.gov//api/v2/search/spending_by_transaction/", content_type_json(), body = body)

Send the body as a JSON encoded list.

POST("https://api.usaspending.gov//api/v2/search/spending_by_transaction/", body = body_list, encode = "json")