Skip to content

Unable to use '/rest/adLibrary' endpoint with linkedin-api-python-client #64

@saurabhlalsaxena

Description

@saurabhlalsaxena

I am trying to use the '/adLibrary' LinkedIn Ad Library endpoints using the linkedin-api-python-client but I am unable to get it to work. Keep getting a 404 response.

It is working with CURL but not with linkedin-api-python-client. Providing the code below:

curl -X GET 'https://api.linkedin.com/rest/adLibrary?q=criteria&keyword=linkedin&advertiser=linkedin' -H 'X-RestLi-Protocol-Version: 2.0.0' -H 'Linkedin-Version: 202408' -H 'Authorization: Bearer {INSERT_TOKEN}'
from linkedin_api.clients.restli.client import RestliClient

restli_client = RestliClient()

# Make the API request
response = restli_client.finder(
  resource_path="/adLibrary",
  finder_name = "criteria",
  query_params={
    "keyword": "linkedin",
    "advertiser":"linkedin"
  },
  access_token=ACCESS_TOKEN
)
print(response.response)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions