---
updatedAt: 2026-05-26T13:50:15.000Z
agentTools:
  projectIndex: https://docs.getgreenspark.com/llms.txt
---

# Fetch Plastic By Interval

Fetch the Array of spending on impacts of plastic per month.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/v1/reports/plastic-by-interval": {
      "get": {
        "deprecated": true,
        "description": "Fetch the Array of spending on impacts of plastic per month.",
        "operationId": "fetchPlasticByInterval",
        "parameters": [
          {
            "name": "sourceId",
            "required": false,
            "in": "query",
            "description": "The id of the source associated with the impact.",
            "schema": {
              "example": "631b035dcd13c4ad66c6d496",
              "type": "string"
            }
          },
          {
            "name": "triggerId",
            "required": false,
            "in": "query",
            "description": "The id of the trigger associated with the impact.",
            "schema": {
              "example": "281f045dcd23c4ae26c6d498",
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "required": false,
            "in": "query",
            "description": "The beginning of the date filter interval.",
            "schema": {
              "example": "2022-09-01",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": false,
            "in": "query",
            "description": "The end of the date filter interval.",
            "schema": {
              "example": "2022-09-01",
              "type": "string"
            }
          },
          {
            "name": "metadata",
            "required": false,
            "in": "query",
            "description": "You can filter the data by the provided key-value pairs as Metadata.",
            "schema": {
              "example": "key1,value1;key2,value2",
              "type": "string"
            }
          },
          {
            "name": "sourceType",
            "required": false,
            "in": "query",
            "description": "The source type of the impact, one of \"one-time\", \"subscription\".",
            "schema": {
              "example": "one-time",
              "type": "string",
              "enum": [
                "one-time",
                "subscription"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The report has been successfully queried.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "The type of the spending."
                      },
                      "amount": {
                        "type": "number",
                        "description": "The amount of the spending."
                      },
                      "month": {
                        "type": "string",
                        "description": "The month when your impacts were created."
                      }
                    }
                  },
                  "example": [
                    {
                      "type": "plastic",
                      "amount": 1,
                      "month": "2022-09"
                    },
                    {
                      "type": "plastic",
                      "amount": 2,
                      "month": "2022-08"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request."
          },
          "401": {
            "description": "Provide a valid x-api-key header. Keys are created in the Greenspark dashboard after registration (separate key per environment)."
          },
          "403": {
            "description": "Requires premiumBusiness, premiumBusinessYearly, or enterpriseBusiness subscription."
          },
          "404": {
            "description": "Not found."
          },
          "422": {
            "description": "422 Unprocessable Entity when API quota is exhausted (MAX_API_CALLS_REACHED)."
          }
        },
        "security": [
          {
            "access-key": []
          }
        ],
        "summary": "Fetch Plastic By Interval",
        "tags": [
          "Reports"
        ]
      }
    }
  },
  "info": {
    "title": "Reporting",
    "description": "Query impact and spend reports. Use GET /v2/reports (fetchRawReportV2) as the canonical raw export; v1 report routes are deprecated.\n\nAuthentication: `x-api-key` header (required). Create keys in the Greenspark dashboard after registration — separate key per environment.\n\nEnvironments: `https://api.getgreenspark.com` (production key) or `https://sandbox.getgreenspark.com` (sandbox key). Always match host and key.\n\nReadMe MCP (v1): `https://greenspark.readme.io/mcp` — read-only live calls on enabled GET routes. POST/PUT/DELETE are documented for integration building; use `get-endpoint` for schemas, not `execute-request` for writes.\n\nAPI keys: Accepts all standard API key types — individual routes may restrict allowed types.",
    "version": "v1",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.getgreenspark.com",
      "description": "Production environment — use a production API key with this host."
    },
    {
      "url": "https://sandbox.getgreenspark.com",
      "description": "Sandbox environment — use a sandbox API key with this host."
    },
    {
      "url": "https://demo-api.getgreenspark.com",
      "description": "Demo environment — use a demo API key with this host."
    }
  ],
  "components": {
    "securitySchemes": {
      "access-key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
```