<!--
{
  "documentType" : "article",
  "framework" : "professional_video_applications",
  "identifier" : "/documentation/Professional-Video-Applications/using-fxplug-apis",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Using FxPlug APIs"
}
-->

# Using FxPlug APIs

Use various FxPlug APIs to communicate with host apps like Motion or Final Cut Pro.

## Discussion

When your plug-in needs to access a host’s capabilities, use the associated FxPlug API that corresponds to the capability you need to access.

Your plug-in can instantiate host API objects that let you communicate and interact with the host application to extend your plug-in’s functionality. A host API implements methods that your plug-in can call to get a specific functionality—such as requesting information about a video stream, or reading a parameter value from the UI.

A host API is analogous to a callback suite in other plug-in architectures, but is implemented as a protocol in FxPlug.

FxPlug defines host protocols for common tasks, including:

- Requesting layer information
- Converting between canvas and object coordinate spaces
- Building a list of plug-in parameters
- Getting and setting parameter values
- Evaluating input images at arbitrary times

> Note:
> Not all host applications support all of the host API protocols in FxPlug. Make sure your plug-in requests the host API object before invoking its methods.

### Get the most recent versions for host APIs

In FxPlug, you may see similar APIs, differing by only a version number appended at the end. You should always use the latest version available for your plug-in. FxPlug 4 only supports the latest versions. FxPlug includes older versions of the host APIs so previous plug-ins continue to work, unless otherwise marked as deprecated. However, improved and expanded functionality is only available in the latest versions. For example, choose [`FxParameterCreationAPI_v5`](/documentation/professional_video_applications/FxParameterCreationAPI_v5), as earlier versions aren’t accessible in FxPlug 4.

### Use a host API

In this example, you find a slider’s value at a particular render time. In the [`pluginState(_:at:quality:)`](/documentation/professional_video_applications/FxTileableEffect/pluginState(_:at:quality:)) method, you use the latest version of the parameter retrieval host API ([`FxParameterRetrievalAPI_v6`](/documentation/professional_video_applications/FxParameterRetrievalAPI_v6)) to retrieve a brightness value created in your plug-in’s [`addParameters()`](/documentation/professional_video_applications/FxTileableEffect/addParameters()) method. Then add the value to pluginState NSData object for later retrieval.

```swift
func pluginState(_ pluginState: AutoreleasingUnsafeMutablePointer<NSData>?, at renderTime: CMTime, quality qualityLevel: UInt) throws {
        let paramAPI = _apiManager!.api(for: FxParameterRetrievalAPI_v6.self) as! FxParameterRetrievalAPI_v6
        
        var brightness = 1.0
        paramAPI.getFloatValue(UnsafeMutablePointer<Double>(&brightness), fromParameter: 1, at: renderTime)
        
        pluginState?.pointee = NSData.init(bytes: &brightness, length: MemoryLayout.size(ofValue: brightness))
    }
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)