# Search Public Engines

## Prerequisites

* Register with [Sepana](https://app.sepana.io)&#x20;
* Create an API key (API keys can be viewed [here](https://app.sepana.io/account?tab=API+Access)).

<figure><img src="https://3736019858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLqoVYS5uYnEW9xSAi3O8%2Fuploads%2FPyYCAHT70CviG6dO9bWq%2FScreenshot%202022-12-02%20at%203.31.06%20PM.png?alt=media&#x26;token=c6b8f746-a036-48dd-ba94-4a7a1bb623b3" alt=""><figcaption></figcaption></figure>

## Steps

### Fetch API key

This step requires a user to fetch a valid API key from their Sepana dashboard. For this particular example, we will be copying the API key with the name "**read-only-key**" displayed in the above image. Click on ![](https://3736019858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLqoVYS5uYnEW9xSAi3O8%2Fuploads%2FiVPXY9OFJunZWd9PxyUa%2FScreenshot%202022-12-02%20at%203.36.01%20PM.png?alt=media\&token=de1edccd-0cc0-4377-b5e4-32fa190a0953)to copy the API key.&#x20;

```
API_KEY = "Gh_rNsAhI-9Ws2BbmqrJpZ49pFkUZuZtsrE_FEg5N5Wce6hAQZoCpQ"
```

### List Public Engines

Use the API key obtained in the [previous section](#copy-any-api-key-associated-with-your-account) to list the available Public Engines within Sepana. The [List Public Engines endpoint](https://docs.sepana.io/sepana-search-api/web3-search-cloud/search-api#list-public-engines) can be used to fetch this.

{% code title="Request" %}

```bash
curl --location --request GET \
'https://api.sepana.io/v1/engine/public/list' \
--header 'x-api-key: Gh_rNsAhI-9Ws2BbmqrJpZ49pFkUZuZtsrE_FEg5N5Wce6hAQZoCpQ'
```

{% endcode %}

{% code title="Response" %}

```json
[
  {
    "engine_id": "ffea4660-9829-4a56-acf7-eb74b259c372",
    "engine_name": "blockchain-authority",
    "namespace": "d9601b27-e91b-4987-a664-ec9af8769e63",
    "network": "",
    "total_records": 3000,
    "total_size": 70590,
    "created_at": {
      "val": "12/01/2022 12:11:23 PM ",
      "_spec_type": "<class 'datetime.datetime'>"
    }
  },
  {
    "engine_id": "2fa05f86-b999-4be3-9daa-6fd62f381e75",
    "engine_name": "ethglobal-work",
    "namespace": "5ef7b76f-800c-4051-b32c-46d75e4ffeea",
    "network": "",
    "total_records": 940,
    "total_size": 2080,
    "created_at": {
      "val": "12/01/2022 05:24:50 AM ",
      "_spec_type": "<class 'datetime.datetime'>"
    }
  },
  ....
]
```

{% endcode %}

### Select Public Engines

Next, you can choose the Engine of interest from the list obtained in [previous section](#list-public-engines).

Here, we are choosing ***ffea4660-9829-4a56-acf7-eb74b259c372*** (blockchain-authority) and ***2fa05f86-b999-4be3-9daa-6fd62f381e75*** (ethglobal-work)

### Search

Now, that you have the API key and engine ids of the selected Engines. You can now perform "[**Search**](https://docs.sepana.io/sepana-search-api/web3-search-cloud/search-api#search)".

{% code title="Request" %}

```bash
curl --location --request POST 'https://api.sepana.io/v1/search' \
--header 'x-api-key: Gh_rNsAhI-9Ws2BbmqrJpZ49pFkUZuZtsrE_FEg5N5Wce6hAQZoCpQ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "engine_ids": [
        "ffea4660-9829-4a56-acf7-eb74b259c372",
        "2fa05f86-b999-4be3-9daa-6fd62f381e75"
    ],
    "query": {
        "query_string": {
            "query": "india"
        }
    },
    "size": 2,
    "page": 0
}
'
```

{% endcode %}

{% code title="Response" %}

```json
{
    "hits": {
        "total": {
            "value": 4,
            "relation": "eq"
        },
        "max_score": 0.2876821,
        "hits": [
            {
                "_index": "ffea4660-9829-4a56-acf7-eb74b259c372",
                "_type": "_doc",
                "_id": "RfEFzoQBxqv6fmT099iM",
                "_score": 0.2876821,
                "_source": {
                    "Stages": "Series A",
                    "Date": "2021-08-31T00:00:00.000Z",
                    "Investors": "Accel,Bertelsmann India Investments",
                    "Description": "Decentralized personal loans marketplace",
                    "Founder": "Mayank Tewari,Prerit Srivastava",
                    "Website": "https://www.skeps.com/",
                    "Project": "Skeps",
                    "Category": "CeFi",
                    "Sub-categories": "Lending/Borrowing",
                    "Announcement": "",
                    "Fundraising Round": "Skeps - Series A",
                    "Record ID": "recufCOPL5Y7csrNj",
                    "Name": "Skeps",
                    "category_name": "CeFi",
                    "subcategory_name": "Lending/Borrowing",
                    "fundraising_round": "Skeps - Series A",
                    "Investors_name": "Accel, Bertelsmann India Investments",
                    "founders_name": "Mayank Tewari, Prerit Srivastava",
                    "Created": "2021-09-06T08: 22:21.000Z",
                    "Amount": "9500000",
                    "Investors copy": "",
                    "Valuation": ""
                }
            },
            {
                "_index": "2fa05f86-b999-4be3-9daa-6fd62f381e75",
                "_type": "_doc",
                "_id": "RvELzoQBxqv6fmT0odgB",
                "_score": 0.13353139,
                "_source": {
                    "indicator": {
                        "id": "NY.GDP.MKTP.CD",
                        "value": "GDP (current US$)"
                    },
                    "country": {
                        "id": "IN",
                        "value": "India"
                    },
                    "countryiso3code": "IND",
                    "date": "2021",
                    "value": 3173397590816.91,
                    "unit": "",
                    "obs_status": "",
                    "decimal": 0
                }
            }
        ]
    },
    "aggregations": null
}
```

{% endcode %}
