Package: meltano-tap-facebook
tap-facebookSinger tap for extracting data from the Facebook Marketing API.Built with theMeltano Singer SDK.Capabilitiescatalogstatediscoveraboutstream-mapsschema-flatteningSettingsSettingRequiredDefaultDescriptionaccess_tokenTrueNoneThe token to authenticate against the API serviceapi_versionFalsev16.0The API version to request data from.account_idTrueNoneYour Facebook Account ID.start_dateFalseNoneThe earliest record date to syncend_dateFalseNoneThe latest record date to syncstream_mapsFalseNoneConfig object for stream maps capability. For more information check outStream Maps.stream_map_configFalseNoneUser-defined config values to be used within map expressions.flattening_enabledFalseNone'True' to enable schema flattening and automatically expand nested properties.flattening_max_depthFalseNoneThe max depth to flatten schemas.A full list of supported settings and capabilities is available by running:tap-facebook --aboutInstallationpipxinstallgit+https://github.com/MeltanoLabs/tap-facebook.gitConfigurationMeltano VariablesThe following config values need to be set in order to use with Meltano. These can be set inmeltano.yml, viameltano config tap-facebook set --interactive, or via the env var mappings shown above.access_token:access token from TAP_FACEBOOK_ACCESS_TOKEN variablestart_date:start dateend_date:end_dateaccount_id:account ID from TAP_FACEBOOK_ACCOUNT_ID variableapi_version:api versiontap-facebook--aboutElastic License 2.0The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software.Attribution WindowAttribution Window is time period during which conversions might be credited to ads, we can have this time period between 1 day to 7 days for clicks and viewsaction_attribution_windows:We can add these variable to params, it will have a list type value which takes in 1d-7d clicks and 1d-7d views values. We have added
this variable in get_url_params function of ads insights streamAuthenticationA Facebook access token is required to make API requests. (SeeFacebook APIdocs for more info)UsageAPI Limitation - Rate LimitsHitting the rate limit for the Facebook API while making requests will return the following error:400 Client Error: b'{"error":{"message":"(#80004) There have been too many calls to this ad-account. Wait a bit and try againThis error is handled using theBackoff Library, and the program will cease for a random amount of time before
attempting to call the API againExecuting the Tap Directlytap-facebook--version
tap-facebook--help
tap-facebook--configCONFIG--discover>./catalog.jsonContributingThis project uses parent-child streams. Learn more about themhere.Initialize your Development Environmentpipxinstallpoetry
poetryinstallCreate and Run TestsCreate tests within thetap_facebook/testssubfolder and
then run:poetryrunpytestYou can also test thetap-facebookCLI interface directly usingpoetry run:poetryruntap-facebook--helpTesting withMeltanoNote:This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios.Your project comes with a custommeltano.ymlproject file already created. Open themeltano.ymland follow any"TODO"items listed in
the file.Next, install Meltano (if you haven't already) and any needed plugins:# Install meltanopipxinstallmeltano# Initialize meltano within this directorycdtap-facebook
meltanoinstallNow you can test and orchestrate using Meltano:# Test invocation:meltanoinvoketap-facebook--version# OR run a test `elt` pipeline:meltanoelttap-facebooktarget-jsonlSDK Dev GuideSee thedev guidefor more instructions on how to use the SDK to
develop your own taps and targets.