---
title: Fetch a single forecast by sourceId
slug: fetch-a-single-forecast-by-sourceid
docTags: 
createdAt: 2024-04-26T20:42:16.945Z
---

{
  "id": "4Q_MB5dqqbytQuvnC7sSo",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://data.onxecta.com/api/production/network/{sourceNetworkId}/forecast/{sourceId}",
    "servers": [
      {
        "url": "https://data.onxecta.com/api/production/network/{sourceNetworkId}/forecast/{sourceId}",
        "description": "AWS Cloud API Endpoint"
      },
      {
        "url": "http://localhost/api/production/network/{sourceNetworkId}/forecast/{sourceId}",
        "description": "Local Testing API Endpoint"
      }
    ],
    "name": "Fetch a single forecast by sourceId",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "sourceNetworkId",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "sourceId",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "NetworkSourceForecast",
            "schema": [
              {
                "name": "xid",
                "kind": "required",
                "type": "string<uuid>",
                "description": "xecta unique identifier",
                "format": "uuid"
              },
              {
                "name": "sourceNetworkId",
                "kind": "required",
                "type": "string",
                "description": "SourceNetworkId the network source belongs to"
              },
              {
                "name": "sourceNetworkSourceId",
                "kind": "required",
                "type": "string",
                "description": "Source ID for the network source definition. This sourceID enables upsert functionality from client source systems of record"
              },
              {
                "name": "forecastValidDate",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date the forecast becomes valid. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28</p><div></div>+0000<p></p>",
                "format": "date-time"
              },
              {
                "name": "date",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date of the forecasted rates. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28</p><div></div>+0000<p></p>",
                "format": "date-time"
              },
              {
                "name": "oilRate",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Forecasted oil rate, STB/d</p>",
                "format": "double"
              },
              {
                "name": "gasRate",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Forecasted gas rate, Mscf/d</p>",
                "format": "double"
              },
              {
                "name": "waterRate",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Forecasted water rate, STB/d</p>",
                "format": "double"
              }
            ],
            "modelRef": "#/components/schemas/NetworkSourceForecast",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "h4B9DX4h5Bzf7vG1bG-m0",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://data.onxecta.com/api/production/network/{sourceNetworkId}/forecast/{sourceId} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "WroUDUrDQ_4zSu3MVgfS4",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://data.onxecta.com/api/production/network/{sourceNetworkId}/forecast/{sourceId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "asJC15U-qXWvlvprKT_-L",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://data.onxecta.com/api/production/network/{sourceNetworkId}/forecast/{sourceId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "395r9wrK9UJdLxDt6Xvi5",
          "language": "csharp",
          "label": "C#",
          "code": "var options = new RestClientOptions(\"https://data.onxecta.com\")\n{\n   MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"/api/production/network/{sourceNetworkId}/forecast/{sourceId}\", Method.Get);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        },
        {
          "id": "eMbYhSbE_cmDP630hoxp1",
          "language": "java",
          "label": "Java",
          "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n   .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n   .url(\"https://data.onxecta.com/api/production/network/{sourceNetworkId}/forecast/{sourceId}\")\n   .method(\"GET\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "h4B9DX4h5Bzf7vG1bG-m0"
    },
    "results": {
      "languages": [
        {
          "id": "KE2RP9rdgH5oKwehQRnAz",
          "language": "200",
          "code": "// OK\n{\n  \"xid\": \"\",\n  \"sourceNetworkId\": \"\",\n  \"sourceNetworkSourceId\": \"\",\n  \"forecastValidDate\": \"\",\n  \"date\": \"\",\n  \"oilRate\": \"\",\n  \"gasRate\": \"\",\n  \"waterRate\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "KE2RP9rdgH5oKwehQRnAz"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}