Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new API #51

Open
antoineeripret opened this issue Jan 31, 2022 · 4 comments
Open

Add support for new API #51

antoineeripret opened this issue Jan 31, 2022 · 4 comments

Comments

@antoineeripret
Copy link
Contributor

Hey @joshcarty,

Google announced a new API for GSC: https://developers.google.com/search/blog/2022/01/url-inspection-api. Do you want to extend your package to support it or do you rather stick to performance reporting only?

Just asking before starting to work on it, because the structure is pretty different :)

Thanks!

@antoineeripret
Copy link
Contributor Author

Hey @joshcarty:

I don't know if you are interested in the new functionality I've mentioned some months ago or if you have time at the moment. I think it could enhance your library, though.

I've started to look into the logic, and with a simple new class , we could extract the information we need:

class IndexInspect:  
  def get(self,urls):
    results = []
    for url in urls:
      request = {
          'siteUrl': domain,
          'inspectionUrl': url
      }
      results.append(account.service.urlInspection().index().inspect(body=request).execute())
    
    return results

In its current state, the code would output the following, but the idea is obviously to add a to_dataframe() method, as you did for the query class.

image

Should I make a PR adding this new class (and other relevant code) to allow you library to handle this new API functionality?

@joshcarty
Copy link
Owner

Thanks for this @antoineeripret - I'll review your PR this week!

@andreamoro
Copy link

It sounds like this was never implemented?

Taking a chance to "promote" the integration into my library.
https://github.com/andreamoro/GSC-Wrapper/tree/URL-Inspection-Integration

The query part is major refactoring from Josh's original work.

@antoineeripret happy to hear your comments.

@antoineeripret
Copy link
Contributor Author

Hi @andreamoro, I'll have a look if I have a moment this week (two bank holidays in Spain). Thanks for the heads-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants