google-searchconsole icon indicating copy to clipboard operation
google-searchconsole copied to clipboard

Added support for indexing API

Open antoineeripret opened this issue 3 years ago • 3 comments

See https://github.com/joshcarty/google-searchconsole/issues/51 for reference

The code changes TL;DR:

  • Added a new property to the WebProperty object
  • Added a new Class to get the indexing information from GSC API

Works well on my side, even if data is slow to gather (this is due to how the API operates, though). I'd be happy to document better what I've done (inside the query.py file + improve the readme.md) if the change is okay for you.

Thanks!

antoineeripret avatar Aug 16 '22 18:08 antoineeripret

Looks like a great start @antoineeripret - thanks for this!

Even though the API request here is quite simple, I'd be keen to preserve the querying and results interfaces as much as possible.

That would be something like:

statuses = webproperty.index_status.urls('www.example1.com', 'www.example2.com').get()
df = statuses.to_dataframe()

That would mean:

  1. Creating the IndexStatus class similarly to Query in that its methods update an internal state and get actually makes the request.
  2. Create a IndexStatusReport class to store the results. That's where you would call to_dataframe from.
  3. You might want to create a separate module for those two classes.

Thanks again for this. The existing Query and Report classes should provide a good reference and let me know if I can help.

joshcarty avatar Aug 17 '22 09:08 joshcarty

@joshcarty: applied your changes! Please let me know if that's okay, and I'll add comments + update the readme.md :)

antoineeripret avatar Aug 17 '22 10:08 antoineeripret

Thanks for making those changes @antoineeripret - I'll provide more feedback this week.

joshcarty avatar Aug 23 '22 11:08 joshcarty