---
lang: en
title: 'API docs: metadata.namespacedreflect.getmetadata'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/metadata
permalink: /doc/en/lb4/apidocs.metadata.namespacedreflect.getmetadata.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [NamespacedReflect](./metadata.namespacedreflect.md) &gt; [getMetadata](./metadata.namespacedreflect.getmetadata.md)

## NamespacedReflect.getMetadata() method

lookup metadata from a target object and its prototype chain

**Signature:**

```typescript
getMetadata(metadataKey: string, target: Object, propertyKey?: string): any;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

metadataKey


</td><td markdown="1">

string


</td><td markdown="1">


</td></tr>
<tr><td markdown="1">

target


</td><td markdown="1">

Object


</td><td markdown="1">


</td></tr>
<tr><td markdown="1">

propertyKey


</td><td markdown="1">

string


</td><td markdown="1">

_(Optional)_


</td></tr>
</tbody></table>

**Returns:**

any


