---
title: lookup
summary: Look up the data associated with a particular User-Agent string.
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/device_detection/fn.lookup/
---

**Kind:** Function  
**Module:** [device_detection](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/device_detection/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/device_detection.h#L72

```cpp
fastly::expected<std::optional<Device>> fastly::device_detection::lookup(std::string_view user_agent)
```

Look up the data associated with a particular User-Agent string.

Non-transactional cache lookup with string key.

**Parameters**

- `user_agent`: `std::string_view`

**Returns**

`fastly::expected<std::optional<Device>>`
