# Batch Get company wells

**URL:** <https://forum.api.combocurve.com/t/batch-get-company-wells/325>\
**Category:** Guidance\
**Created:** [July 2, 2024, 2:05pm UTC](https://forum.api.combocurve.com/t/batch-get-company-wells/325 "2024-07-02T14:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffreyrs](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@jeffreyrs](https://forum.api.combocurve.com/u/jeffreyrs)\
**Post date:** [July 2, 2024, 2:05pm UTC](https://forum.api.combocurve.com/t/batch-get-company-wells/325/1 "2024-07-02T14:05:03Z")

</div>

Hello,

I’m seeing some behavior that is confusing to me. I am trying to get all the company wells within a project/scenario.

First, I get the unique id of the wells within a project

```auto
url_scenario = 'https://api.combocurve.com/v1/projects/[project]/scenarios/[scenario]/well-assignments'
result, has_error = request_with_handling(
        URL_SCENARIO, "get", headers=_get_combo_curve_api_token()
    )
well_list = result.json()["wells"]

```

The part is straightforward. Next I want to get the attributes of these wells from our wells endpoint. I chunk this list of wells then send the request. My uncertainty is how to get all wells in my list. The docs suggest I can just send the list directly at the end of the URL. That’s how I’ve tried it, and I get no error from the response, but the return wells do not match what I requested. I can request one individual well, but it doesn’t make sense to hammer the API with 1000s of API calls. Is there a better approach that what I have done?

![image](https://canada1.discourse-cdn.com/flex035/uploads/the_combocurve_api/original/1X/cbc9e18a2cbf15839a0ce8d4baf056eb3ec69fe9.png)

Here is the code that doesn’t throw an error but returns the wrong well list:

```auto
url_wells = 'https://api.combocurve.com/v1/wells'
    for idx, well_chunk in enumerate(ichunked(well_ids, chunk_length)):
        logging.info(
            f"Scenario Wells Pull: Getting chunk "
            f"{idx + 1} of {len(well_ids) // chunk_length}"
        )
        ids = list(well_chunk)
        result, has_error = request_with_handling(
            URL_WELLS,
            "get",
            headers=_get_combo_curve_api_token(),
            params={"take": chunk_length, "": ids},
        )
        if has_error:
            return well_list_df
        wells = pd.DataFrame(result.json())
        well_list.append(wells)

```

Thanks for the input, Jeff.

---

<div class="post-metadata">

**Author:** ![dfulford](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@dfulford](https://forum.api.combocurve.com/u/dfulford)\
**Post date:** [July 4, 2024, 2:00pm UTC](https://forum.api.combocurve.com/t/batch-get-company-wells/325/2 "2024-07-04T14:00:46Z")

</div>

I don’t believe there is a way to get the header data for a list of well ids in a single request.

The better way would be to get all company wells in a project, and then filter that list with the ids from the scenario of interest.

---

<div class="post-metadata">

**Author:** ![josh](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.api.combocurve.com/josh/32/172_2.png) [@josh](https://forum.api.combocurve.com/u/josh)\
**Post date:** [July 4, 2024, 5:48pm UTC](https://forum.api.combocurve.com/t/batch-get-company-wells/325/3 "2024-07-04T17:48:54Z")

</div>

Yeah I do this like @dfulford described - I use [get-project-company-wells](https://docs.api.combocurve.com/#39e3a750-f339-44e9-8a95-4792c3147194) to get the headers for every company well in the project (optionally combining it with the headers for regular project wells, from [get-project-wells](https://docs.api.combocurve.com/#c246302f-9054-493e-aa9c-ab844147581d)) and filter it afterwards.
