# Search Loop Links

## GET /v1/loop/links

> Search Loop Links

```json
{"openapi":"3.1.0","info":{"title":"PredictHQ Loop API","version":"1.0.0"},"tags":[{"name":"Loop Links"}],"servers":[{"url":"https://api.predicthq.com"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"$API_KEY","description":"Enter your PredictHQ API key. The Bearer prefix is added automatically.\n\nWhen calling the API directly, send: `Authorization: Bearer <YOUR_API_KEY>` as documented at [https://docs.predicthq.com/api/overview/authenticating](https://docs.predicthq.com/api/overview/authenticating)\n"}},"parameters":{"OffsetParam":{"name":"offset","in":"query","description":"Offset the results.","required":false,"schema":{"type":"integer","default":0}},"LimitParam":{"name":"limit","in":"query","description":"Limit the number of results.","required":false,"schema":{"type":"integer","default":10}}},"schemas":{"PublicSearchLinkResponse":{"type":"object","properties":{"count":{"type":"integer","title":"Count"},"next":{"description":"URL to next page","anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}]},"previous":{"description":"URL to previous page","anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/PublicLink"},"title":"Links"}},"required":["count","links"],"title":"PublicSearchLinkResponse"},"PublicLink":{"type":"object","properties":{"link_id":{"description":"Loop Link Identifier.\n\n\nE.g. `ber7ntO0ZHuFVCfrSNsN`","type":"string","title":"Link Id"},"expire_dt":{"description":"Date/time the Loop Link is set to expire in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\n\nAll dates are in UTC.\n\n\nE.g. `2023-05-08T00:29:45.859Z`","type":"string","format":"date-time","title":"Expire Dt"},"metadata":{"description":"Metadata can be used to further identify Loop Links in a way that makes sense for your system.\n\n\nThe field is a key/value field that accepts string-based keys and string or numeric values.\n\n\nThis can be useful for storing additional data such as a end-user identifier or store ID etc.","type":"object","additionalProperties":true,"title":"Metadata"},"name":{"description":"Name of the Loop Link. This is for your own use as a way to differentiate your Loop Links.\n\n\nE.g. `Hotel ABC`","type":"string","maxLength":120,"minLength":1,"pattern":"^[a-zA-Z0-9 _-]+$","title":"Name"},"status":{"description":"Status of the loop link.","$ref":"#/components/schemas/LinkStatus"},"create_dt":{"description":"Date/time the Loop Link was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\n\nAll dates are in UTC.\n\n\nE.g. `2023-05-08T00:29:45.859Z`","type":"string","format":"date-time","title":"Create Dt"},"update_dt":{"description":"Date/time the Loop Link was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\n\nAll dates are in UTC.\n\n\nE.g. `2023-05-08T00:29:45.859Z`","type":"string","format":"date-time","title":"Update Dt"},"links":{"description":"These are the links your end-users need to open to access the Loop UI for submitting missing events or feedback about existing events.\n\nThe different link types are: \n- event: This URL will present a page for submitting missing events.   \n- event_feedback: This URL will present a page for providing feedback about an existing event.\n\n\nWhen using the event link you can optionally provide the following query string parameters:\n- email: Email address of the end-user who is providing the feedback. This will be stored against the submission so the user can receive email notifications about their submission.\n\nWhen using the event_feedback link you can optionally provide the following query string parameters:\n- event_id: Event ID to provide the feedback for (if this is not provided, the user will be asked to enter an Event ID).\n- email: Email address of the end-user who is providing the feedback. This will be stored against the submission so the user can receive email notifications about their submission.","type":"object","additionalProperties":false,"properties":{"event":{"description":"URL for submitting missing events.","type":"string","format":"uri","maxLength":2083,"minLength":1},"event_feedback":{"description":"URL for providing feedback about an existing event.","type":"string","format":"uri","maxLength":2083,"minLength":1}},"required":["event","event_feedback"],"title":"Links"}},"required":["link_id","name","status","create_dt","links"],"title":"PublicLink"},"LinkStatus":{"type":"string","const":"active","title":"LinkStatus"},"HTTPValidationError":{"type":"object","properties":{"detail":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail"}},"title":"HTTPValidationError"},"ValidationError":{"type":"object","properties":{"loc":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/loop/links":{"get":{"operationId":"search_links_links_get","summary":"Search Loop Links","parameters":[{"$ref":"#/components/parameters/OffsetParam"},{"$ref":"#/components/parameters/LimitParam"},{"name":"q","in":"query","description":"Full-text search.\n\n\nE.g. `?q=hotel+a`","required":false,"schema":{"type":"string","maxLength":120,"minLength":1,"pattern":"^[a-zA-Z0-9 _-]+$","title":"Q"}},{"name":"link_id","in":"query","description":"Comma-separated list of `link_id`.\n\n\nE.g. `?link_id=m4Dk4g4DRA8Yqbp2PC54`","required":false,"schema":{"description":"A comma-separated list of Loop Link IDs","type":"array","items":{"type":"string"},"title":"Link Id"},"explode":false,"style":"form"},{"name":"user_id","in":"query","description":"Comma-separated list of `user_id`.\n\n\nE.g. `?user_id=hw8Dsmv4Djg`","required":false,"schema":{"description":"A comma-separated list of user IDs","type":"array","items":{"type":"string"},"title":"User Id"},"explode":false,"style":"form"},{"name":"sort","in":"query","description":"Comma-separated list of sort options.\n\n\nE.g. `?sort=name`","required":false,"schema":{"description":"A comma-separated list of sort params","type":"array","items":{"type":"string","enum":["created","-created","expires","-expires","name","-name","updated","-updated"]},"title":"Sort"},"explode":false,"style":"form"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSearchLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"tags":["Loop Links"]}}}}
```

## Examples

{% tabs %}
{% tab title="curl" %}

```bash
curl -X GET "https://api.predicthq.com/v1/loop/links?sort=name" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $ACCESS_TOKEN"
```

{% endtab %}

{% tab title="python" %}

```python
import requests

response = requests.get(
    url="https://api.predicthq.com/v1/loop/links",
    headers={
      "Authorization": "Bearer $ACCESS_TOKEN",
      "Accept": "application/json"
    },
    params={
        "sort": "name"
    }
)

print(response.json())
```

{% endtab %}
{% endtabs %}

## OpenAPI Spec

The OpenAPI spec for Loop API can be [found here](https://api.predicthq.com/docs/?urls.primaryName=Loop+API).

## Guides

ow are some guides relevant to this API:

* [Integrate with Loop Links](https://app.gitbook.com/s/tNhzHETmXsrWeVBndqqJ/integrations/integration-guides/integrate-with-loop-links)
