How to fix pd.json_normalize so it will take info from filters (MONDAY API)

Hello, I have a python code, which I use to take information from Monday website using API (with key). But i do not know how filters work with pd.json_normalize python function. I don’t think it is written ok, because I believe column{title} should be written somewhere (maybe in the meta?). Can someone help me? I believe that data and record path are written alright and I need help with meta. Thanks in advance :slight_smile:

# Initialize an empty DataFrame to store the features
item_features = pd.DataFrame()

# Reset index of pulse_3 DataFrame
pulse_3 = pulse_3.reset_index(drop=True)

# Loop through the pulse_3 DataFrame
for i in range(1,len(pulse_3)):
    # Construct the query for the API
    q_features = (
        "{boards(ids:" 
        + pulse_3.loc[i, 'board_id'] 
        + "){items_page (limit:500){cursor items {id name column_values{... on MirrorValue {display_value} ... on BoardRelationValue{display_value} column{title} text}}}}}"
    )
    
    # Package the query as JSON
    q_features = {"query": q_features}
    
    # Send the request to the API
    r_features = requests.post(url=apiUrl, json= q_features, headers=headers)
    
    # Convert the response to JSON
    features_json = r_features.json()
    
    # Flatten the JSON data into a DataFrame
    df_features_norm = pd.json_normalize(
       features_json['data']['boards'][0]['items_page'],
       record_path=['items','column_values'],
       meta=[
            ['items', 'id'],
            ['items', 'name'],
       ],
       errors="ignore",
    )
    # Insert 'board_id' column
    df_features_norm.insert(0, "board_id", pulse_3.loc[i, "board_id"])

    # Add delay if necessary
    if i%100 == 0:
        time.sleep(225)
        
    # Concatenate the current DataFrame with the item_features DataFrame
    item_features = pd.concat([item_features, df_features_norm], ignore_index=True)
item_features = item_features[item_features['title'].isin([
    'Code',
    'Link to PRICE LIST',
    'Price',
    'Min.time',
    'Person',
    'Status',
    'Agreed (h)',
    'Agreed (EUR)',
    'Actual',
    'Last Updated',
    'Completed',
    'Term',
    'ERR',
    'NS',
    'PVS_Code'
    ])].drop_duplicates(subset=['board_id','items.id','title'])
item_features = (
    item_features.set_index(["board_id", "items.id", "items.name", "title"])["text"]
    .unstack()
    .reset_index()
)
item_features = (
    item_features.merge(
        df_boards_norm[["id", "name"]], left_on="board_id", right_on="id"
    )
    .drop("id", axis=1)
    .rename(columns={"name": "board_name"})
)
item_features.head(30)